• 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: How to determine if a file is completely copied?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >How to determine if a file is completely copied? (From: Gustavo Vera <email@hidden>)

  • Prev by Date: Drop Down Toolbar Button
  • Next by Date: Re: Adding Multiple NSWindow or NSPanel into another NSWindow
  • Previous by thread: Re: How to determine if a file is completely copied?
  • Next by thread: serialPortSample... hang on "read" function
  • Index(es):
    • Date
    • Thread