• 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: Checking if a file is Locked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Checking if a file is Locked
      • From: Deric Horn <email@hidden>
References: 
 >Checking if a file is Locked (From: Chad Armstrong <email@hidden>)

  • Prev by Date: Re: [NSPasteboard setPropertyList:forType:] is buggy...
  • Next by Date: Re: Checking if a file is Locked
  • Previous by thread: Re: Checking if a file is Locked
  • Next by thread: Re: Checking if a file is Locked
  • Index(es):
    • Date
    • Thread