Re: Determining if a file is still being copied
Re: Determining if a file is still being copied
- Subject: Re: Determining if a file is still being copied
- From: Ryan McGann <email@hidden>
- Date: Sat, 23 Jul 2005 00:38:44 -0700
I don't know if there are any high-level functions for this. But you
can always parse lsof output:
lsof /path/to/file
or do it yourself, source code:
http://www.opensource.apple.com/darwinsource/10.4/lsof-20/
No, DON'T. Apple considers the data structures used by lsof to be
private and they can (and have before) change between OS revisions.
Instead, look in Finder.h (part of CarbonCore.framework). You can
either check the kExtendedFlagObjectIsBusy flag using
FSGetCatalogInfo, which is set by the Tiger finder when copying
files. Alternatively, you can check the file creator using
FSGetCatalogInfo to see if it is in the range of
kFirstMagicBusyFiletype to kLastMagicBusyFiletype.
Of course 3rd party applications may not follow these guidelines, but
in general semantics of a file copy are loosely defined anyway, so
determining if a file is being "copied" is somewhat difficult to
begin with.
Ryan
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden