• 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
Re: Locking
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Locking


  • Subject: Re: Locking
  • From: Wade Tregaskis <email@hidden>
  • Date: Wed, 16 Jun 2004 20:44:39 +1000

2. locked the file with FInder - can NOT be deleted by NSFileManager.
2a tried rm. It asked me "override uchg", I answered "y", it replied "Operation not permitted". So why ask in the first place? But at least consistent.
(The file now has: "NSFileImmutable=1")

I'm not sure of the mechanics of it, but on the face of it this is a bug - in my experience only the root user can overwrite the permissions (and even then only sometimes); a non-root user should never be asked.

But now the final question: how can I find out the app, which has the file still open?
Which probably amounts to the question: has the filesystem only a bit "file open" or a list of int flags "file open by pid 12345" , "file open by pid 4321", ... ?

Under Classic MacOS you could find out which app had exclusive access to a file, although I don't know how; I only know that many applications (including the Finder) displayed this information at various times. It was particularly handy when you had a removable volume mounted and wanted to know why it can't be unmounted... under OS X it just throws up some useless generic error message.

Although usually it's just Terminal, which for some reason prevents most (all?) removable volumes being removed while it's open. Even disk images and the like. Weird.

Wade Tregaskis (aim: wadetregaskis)
-- Sed quis custodiet ipsos custodes?
_______________________________________________
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.


References: 
 >Locking (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: Locking (From: "Gerriet M. Denkmann" <email@hidden>)

  • Prev by Date: NSOpenPanel runModalForTypes: trouble (was: lowercaseString on Jaguar)
  • Next by Date: Re: option-click hides apps
  • Previous by thread: Re: Locking
  • Next by thread: Re: Locking
  • Index(es):
    • Date
    • Thread