[Biococoa-dev] opening greyed out files

Tenzin Togden ttenzin at gmail.com
Fri Dec 23 14:12:27 EST 2005

On 12/23/05, Koen van der Drift <kvddrift at earthlink.net> wrote:
> On Dec 22, 2005, at 1:01 PM, Tenzin Togden wrote:
> > Would this modified to suit your needs work ?
> >
> > find . -type f -print0 | xargs -0 -n 1 SetFile -a l
> >
> > Unlocks all the files in the current directory and below.
> >
> >
> > find . -type f -print0 | xargs -0 -n 1 SetFile -a L
> >
> > Locks all the files in the current directory and below.
> Looks like a command line command to me, will that work in an
> OpenDialog GUI ?  After reading some more about this, I think the way
> to go is with the Authorization API. However, that seems to be more
> appropropriate for processes, not for files in an OpenDialog. Oh
> well, I guess I'll have some more reading to do ;-)
> - Koen.

I was mistakenly expecting the source for SetFile functions to be available
as an example.

This article http://www.macosxguru.net/article.php?story=20031122090109169

"NSFileManager has the instance method -
(BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString
*)path. The key to set file permissions is NSFilePosixPermissions and its
value must be a NSNumber with an int value, the 9 right most bits describing
the permissions.
You can also use the Carbon functions FSGetCatalogInfo and FSSetCatalogInfo,
but you probably don't want to link to Carbon only for that purpose, and of
course the POSIX functions chmod and fchmod. (man 2 chmod)."

and the NSFileManager documentation possibly has the answer here,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/biococoa-dev/attachments/20051223/5c35c579/attachment.html>

More information about the Biococoa-dev mailing list