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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to