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

Re: DirWatch


  • Subject: Re: DirWatch
  • From: Ken Thomases <email@hidden>
  • Date: Fri, 23 May 2008 04:57:29 -0500

On May 23, 2008, at 2:37 AM, Lorenzo wrote:

Thank you so much Ken,
I would like to use the BSD/POSIX file access routines.

Wait, what? Why? The BSD/POSIX routines are the ones which _won't_ (by default) be useful for detecting if a file is still open in another program.


If you attempt to open a file using the frameworks (Cocoa or Carbon), they will automatically attempt exclusive access. Therefore, you can use that to test if another program has the file open for writing, on some filesystems. Except that, if the other program is using the BSD/ POSIX file access routines and has not been coded to respect advisory locks, then you won't be able to tell that it has the file open.

I see no advantage for you to use the BSD/POSIX routines.


May you give me a pointer?

Sure, if you really think that's what you want. You should just read the man pages for open, read, write, etc. Or you can mix stdio fopen, fread, fwrite, etc. with the flock system call.


Cheers,
Ken

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >Re: DirWatch (From: Lorenzo <email@hidden>)

  • Prev by Date: Re: A documetation suggestion (was Re: Cocoa et al as HCI usability problem)
  • Next by Date: Appkido support for Iphone dev
  • Previous by thread: Re: DirWatch
  • Next by thread: NSMailDelivery deliverMessage Deprecated
  • Index(es):
    • Date
    • Thread