[Q] Unlocking an arbitrary file?
[Q] Unlocking an arbitrary file?
- Subject: [Q] Unlocking an arbitrary file?
- From: Ando Sonenblick <email@hidden>
- Date: Tue, 24 Sep 2002 19:19:26 -0700
Gang,
I9m looking to make a simple app that will take any files dragged onto it
and unlock them. I want this because OSX doesn9t seem to have any feature
like OS9 did: hold down the option key while emptying the trash to allow it
to toss locked files -- unless any of you know how to get the Finder to do
this? I searched, tried all sorts of stuff, asked around but to no avail.
Anwyay, going on the assumption that I9ll need to write an app, I researched
around but only seem to have uncovered pitfalls and not solutions:
Narrowing in on this method (of NSFileManager):
- (BOOL)changeFileAttributes:(NSDictionary *)attributes atPath:(NSString
*)path
I discover that:
(Problem 1) - 3Attributes that you can change are the owner, group, file
permissions, and modification date.2 It doesn9t look like I can change the
immutable attribute, which I9m presuming is the lock bit - documentation
wasn9t helpful - am I mistaken?
Furthermore:
(Problem 2) - 3As in the POSIX standard, the application must either own the
file or directory or must be running as superuser for attribute changes to
take effect.2
Ack! Being still relatively new to Unix, I don9t know what (if?) I9ll need
to do to make my app run as superuser or otherwise have permission to tweak
a file9s attributes...
So... Can anyone either inform me of a different approach to unlock any
file? Or provide insight on solving either of the two problems I9ve
encountered?
Much appreciated,
Ando
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.