Re: Checking if a file is Locked
Re: Checking if a file is Locked
- Subject: Re: Checking if a file is Locked
- From: "Sean McBride" <email@hidden>
- Date: Wed, 29 Nov 2006 12:39:02 -0500
- Organization: Rogue Research
On 2006-11-28 22:08, Chad Armstrong said:
>Is there a way to check if a file is locked? I would preferably like
>to be able to check using Cocoa, but if there is a Carbon or UNIX way
>for checking, that would work, as well.
Be careful how you use this info though. If you do something like:
BOOL isFileLocked = blah blah
if (isFileLocked == NO) {
write to file
}
Then some other process could change the lock state between your check
and your write. Then your write can fail anyway.
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden