• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[Q] Unlocking an arbitrary file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[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.

  • Follow-Ups:
    • Re: [Q] Unlocking an arbitrary file?
      • From: Chris Parker <email@hidden>
    • Re: [Q] Unlocking an arbitrary file?
      • From: Cameron Hayne <email@hidden>
    • Re: [Q] Unlocking an arbitrary file?
      • From: Charles Srstka <email@hidden>
    • Re: [Q] Unlocking an arbitrary file?
      • From: Clark Mueller <email@hidden>
  • Prev by Date: Re: How to make DO not do transformations
  • Next by Date: Re: How to make DO not do transformations
  • Previous by thread: Setting alpha Component while drawAtPoint:myPoint withAttributes:myAttr in NSImageView
  • Next by thread: Re: [Q] Unlocking an arbitrary file?
  • Index(es):
    • Date
    • Thread