Deleting files off flash drive

weekendsrule32

macrumors member
Original poster
Apr 8, 2009
86
0
New Jersey
When i drag and drop files of flash drives into the trash, and then delete them, they are gone on the flash drive on a mac, but when i plug it into a pc ghost files show up. It is more annoying than a problem. Advice?
 

ziggyonice

macrumors 68020
Mar 12, 2006
2,386
1
Rural America
It's probably because of the resource forks.

You see, there are some invisible files that the Mac uses for various things (preferences, icons, etc.) that aren't seen when you use the computer normally. However, Windows isn't smart enough to know what resource forks shouldn't be seen, and keeps them visible.

If you really wanted to delete them, the easiest way is to simply not change any documents or name of the flash drive, etc. when using it on your Mac. Or just delete the files off the drive while on a PC. Or turn invisible files "on" and then delete them.

Or just ignore 'em. :)
 

weekendsrule32

macrumors member
Original poster
Apr 8, 2009
86
0
New Jersey
So if I wanted to open a file and change it on a mac, I should move it off the drive and onto the mac, edit it, save the file on the mac, then transfer the file back to the drive?
 

Gregg2

macrumors 603
May 22, 2008
5,949
419
Milwaukee, WI
If you want the edited version on the Mac, yes. If it's a minor change, you could just open it from the flash drive, edit and save it on the flash drive. It's just slower than your Mac. (just like the old days with floppy disks)
 

Fishrrman

macrumors P6
Feb 20, 2009
18,501
6,265
I didn't see this mentioned yet, but would using the option "Secure Empty Trash" make a difference?

Not sure if this deletes the resource fork as well as the data fork.
 

Makosuke

macrumors 603
Aug 15, 2001
6,168
354
The Cool Part of CA, USA
I didn't see this mentioned yet, but would using the option "Secure Empty Trash" make a difference?

Not sure if this deletes the resource fork as well as the data fork.
If it doesn't delete it with a normal empty trash, Secure Empty Trash won't be any different.

That said, I'm a little surprised that the files are getting left--I would expect the Finder to properly delete the associated resource fork along with its "parent" file. Are you sure the files associated with the orphaned forks didn't get deleted some other way?

For that matter, we haven't even confirmed if these ARE resource forks. What do the phantom file names look like? Are they in the format "._filename.extension", or do they look like something else?
 

drtech

macrumors newbie
Dec 7, 2009
25
0
I would be surprised if this has something to do with resource forks. OS X does not use resource forks (although it does support them for backward compatibility). Plus, resource forks are part of a "multi-fork" file. They wouldn't show up as separate files.

This is probably a case of hidden files. In UNIX style operating systems (like OS X on your Mac), any file preceded by a "." is considered hidden and is not shown unless you give you Mac a specific command to show these files.

However, Windows is not a UNIX style operating system, so, to Windows, these files are just files with a name that starts with a ".". The period has no significance to Windows.

If this is the case, you can simply delete the file in Windows. BUT, you Mac does use many of these files for behind-the-scenes tasks. A perfect example is a file called ".DS_Store" in almost every folder. This saves information for Finder about that folder. If you delete this file in Windows then your Mac will go back to default settings for that folder; but guess what, next time you use the folder on your Mac, it will probably just recreate the file.

(FWIW, Windows also uses hidden files that are invisible in Windows but show up on Mac, so it goes both directions.)

Jeff
 

samh

macrumors 6502
Oct 29, 2009
317
3
It's probably because of the resource forks.

You see, there are some invisible files that the Mac uses for various things (preferences, icons, etc.) that aren't seen when you use the computer normally. However, Windows isn't smart enough to know what resource forks shouldn't be seen, and keeps them visible.
It's got nothing to do with how "smart" Windows is. Windows doesn't use them so it handles them as regular files.
 

chown33

Moderator
Staff member
Aug 9, 2009
8,658
4,903
vertical
OS X does not use resource forks (although it does support them for backward compatibility).
That is simply incorrect. Resource forks are still used in all versions of Mac OS X. A simple example is alias files created by Finder.

Plus, resource forks are part of a "multi-fork" file. They wouldn't show up as separate files.
They do when the file-system doesn't support multiple forks. Then the resource-fork and Finder metadata are stored in a "._"-prefaced file, adjacent to the associated data-fork file. This is called "AppleDouble":

http://en.wikipedia.org/wiki/AppleSingle_and_AppleDouble_formats

Note that a resource-fork isn't the only thing stored in this file. Files that have no resource-fork may have a "._" companion-file. For example, extended attributes are stored there on file-systems that don't have native xattr support.

In general, Finder or any other app will delete, move, or rename any "._" companion-file correctly, because the file-system code rather than Finder itself is responsible for managing these companion-files.


There's really no way to know whether the OP's phantom files are related to resource-forks, metadata, or whatever, until we know exactly what the filenames are.
 

drtech

macrumors newbie
Dec 7, 2009
25
0
That is simply incorrect. Resource forks are still used in all versions of Mac OS X. A simple example is alias files created by Finder.
You are correct. I should have said "rarely" used. Unlike OS 9 and previous, where resource forks were used extensively, Apple has tried to limit use of resource forks in OS X. I was attempting to simplify things a bit without diving into every possible case initially. Thank you for the correction.

There's really no way to know whether the OP's phantom files are related to resource-forks, metadata, or whatever, until we know exactly what the filenames are.
Again, I agree. I was attempting to find the most likely cause first, and being that .DS_Store files are found everywhere, I figured that was the first place to look. As fewer and fewer programs use resource forks, I determined this was a lesser possibility. It seems most times people see the .DS_Store file, blow it away, and then are surprised when it comes back.

Thank you for adding the precision to the post.
 

Similar threads

  • Lekz1
5
Replies
5
Views
571
  • kay2me
4
Replies
4
Views
735
  • Bulldog VII
1
Replies
1
Views
277
Replies
1
Views
405
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.