<br><br><div><span class="gmail_quote">On 12/23/05, <b class="gmail_sendername">Koen van der Drift</b> <<a href="mailto:kvddrift@earthlink.net">kvddrift@earthlink.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>On Dec 22, 2005, at 1:01 PM, Tenzin Togden wrote:<br><br>> Would this modified to suit your needs work ?<br>><br>> find . -type f -print0 | xargs -0 -n 1 SetFile -a l<br>><br>> Unlocks all the files in the current directory and below.
<br>><br>><br>> find . -type f -print0 | xargs -0 -n 1 SetFile -a L<br>><br>> Locks all the files in the current directory and below.<br><br><br>Looks like a command line command to me, will that work in an
<br>OpenDialog GUI ?  After reading some more about this, I think the way<br>to go is with the Authorization API. However, that seems to be more<br>appropropriate for processes, not for files in an OpenDialog. Oh<br>well, I guess I'll have some more reading to do ;-)
<br><br>- Koen.<br></blockquote></div><br>
I was mistakenly expecting the source for SetFile functions to be available as an example.<br>
<br>
This article <a href="http://www.macosxguru.net/article.php?story=20031122090109169">http://www.macosxguru.net/article.php?story=20031122090109169</a>  suggests<br>
<br>
"<code>NSFileManager</code> has the instance method <code>- (BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString *)path</code>. The key to set file permissions is <code>NSFilePosixPermissions</code>
 and its value must be a <code>NSNumber</code> with an <code>int</code> value, the 9 right most bits describing the permissions.<br>

You can also use the Carbon functions <code>FSGetCatalogInfo</code> and <code>FSSetCatalogInfo</code>, but you probably don't want to link to Carbon only for that purpose, and of course the POSIX functions <code>chmod</code>
 and <code>fchmod</code>. (<code>man 2 chmod</code>)."<br>
<br>
and the NSFileManager documentation possibly has the answer here,<br>
<br>
<a href="http://www.toodarkpark.org/computers/objc/Foundation/Classes/NSFileManager.html">http://www.toodarkpark.org/computers/objc/Foundation/Classes/NSFileManager.html</a><br>
<br>
Tenzin<br>