I have tried:
Checking the FSCatalogInfo
nodeFlags
to see if kFSNodeForkOpenBit
is set (using kFSNodeForkOpenMask
).
Checking whether the creator code is between kFirstMagicBusyFiletype
and kLastMagicBusyFiletype
.
Checking the ExtendedFileInfo
extendedFinderFlags
to see if kExtendedFlagObjectIsBusy
is set.
Running GetFileInfo -ab
from the shell.
All of these report that the file the Finder is copying to is not open.
Using lsof
does detect that the file is open, but (a) I don't want to call lsof
from my application, and (b) my understanding is that it relies on private API so looking at its source wouldn't help.
However, in recent years, zero magnification finders that project an apparent target or small red dot on the night sky have become very common. These are known as 'red dot finders' and they have the advantages of producing their own illumination and being intuitive to use." Advertisement.
Using the lsof command, we can find out exactly what process or application is using a specified file at that given moment.
Showing hidden files via Mac FinderPress the “Command” + “Shift” + “.” (period) keys at the same time. The hidden files will show up as translucent in the folder. If you want to obscure the files again, press the same “Command” + “Shift” + “.” (period) combination.
It's about 2 years too late for you now, but I thought for the sake of anybody finding this later I'd note that you can check the creation date of the file. Finder sets it to kMagicBusyCreationDate (1946-02-14 08:34:56 +0000) while it's copying.
In Mac OS X v10.4 and later:
Whilst Finder progresses a copy of a file (not afterwards) the copy has:
brok
MACS
— together, those two things signify file business.
MACS
is the ID of Finder.
Whilst Finder progresses a copy of a file (not afterwards) the copy has a counterpart:
._
file that includes the necessary extended attribute (xattr).Why are dot underscore ._ files created, and how can I avoid them? — Ask Different
If a copy using Finder is interrupted ungracefully, then the presence of brok
MACS
should ensure that breakage/business is recognisable to:
A file big file.dmg
with no extended attribute.
Before copying from JHFS+ to an empty example
directory on a volume that uses MS-DOS (FAT32):
[macbookpro08:~] gjp22% date
Fri 11 May 2012 17:24:29 BST
[macbookpro08:~] gjp22% ls -h@al /Users/gjp22/Documents/uk/ac/brighton/collaborate/bigfile.dmg
-rw-r--r-- 1 gjp22 staff 1.4G 11 May 17:20 /Users/gjp22/Documents/uk/ac/brighton/collaborate/bigfile.dmg
[macbookpro08:~] gjp22% xattr /Users/gjp22/Documents/uk/ac/brighton/collaborate/bigfile.dmg
[macbookpro08:~] gjp22% diskutil list | grep FAT32
1: DOS_FAT_32 FAT32 2.0 GB disk3s1
[macbookpro08:~] gjp22% ls -h@al /Volumes/FAT32/example
total 16
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 17:24 .
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 11:32 ..
brokMACS
within the value of extended attribute com.apple.FinderInfo
:
[macbookpro08:~] gjp22% date
Fri 11 May 2012 17:25:08 BST
[macbookpro08:~] gjp22% ls -h@al /Volumes/FAT32/example
total 311320
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 17:25 .
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 11:32 ..
-rwxrwxrwx 1 gjp22 staff 4.0K 11 May 17:25 ._bigfile.dmg
-rwxrwxrwx@ 1 gjp22 staff 152M 11 May 17:25 bigfile.dmg
com.apple.FinderInfo 32B
[macbookpro08:~] gjp22% xattr -l /Volumes/FAT32/example/bigfile.dmg
com.apple.FinderInfo:
00000000 62 72 6F 6B 4D 41 43 53 00 00 00 00 00 00 00 00 |brokMACS........|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020
That extended attribute is removed:
[macbookpro08:~] gjp22% date
Fri 11 May 2012 17:29:19 BST
[macbookpro08:~] gjp22% xattr -l /Volumes/FAT32/example/bigfile.dmg
[macbookpro08:~] gjp22% ls -h@al /Volumes/FAT32/example
total 3000016
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 17:29 .
drwxrwxrwx 1 gjp22 staff 4.0K 11 May 11:32 ..
-rwxrwxrwx 1 gjp22 staff 1.4G 11 May 17:20 bigfile.dmg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With