Re: How to determine if a file is completely copied?
Re: How to determine if a file is completely copied?
- Subject: Re: How to determine if a file is completely copied?
- From: Ken Thomases <email@hidden>
- Date: Tue, 17 Feb 2009 18:28:50 -0600
On Feb 17, 2009, at 10:25 AM, Gustavo Vera wrote:
I'm trying to get status info from a file on disk, to be more
precise, I
need to know if the file is currently destination of a regular copy
operation.
According to this Tech Note <http://developer.apple.com/technotes/tn/tn2037.html
>, the frameworks always use advisory locking with an exclusive lock
when opening a file for writing, if that feature is supported. If the
Finder is using the frameworks or is otherwise participating in
advisory locking, you can attempt to open the file with a lock of your
own to test if any other process has an exclusive lock.
This doesn't work for programs which are not participating in the
advisory locking scheme -- those that use the BSD/POSIX APIs and don't
follow that Tech Note's advice -- but it's better than nothing.
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