Hidden file woes...

Whenever i transfer something to my PSP, or anything USB for that matter, OSX finds the need to put in not just a ".DS_Store" file, but also a hidden file for each file i transfer. So if i put a movie on my psp i end up with "movie.mp4" and "._movie.mp4" which gets really annoying because the ._movie.mp4 still shows up in the movie list because the psp thinks its an mp4 file. The same applies for every other usb device. Can i keep leo from writing hidden files on usb devices? I know it can be disabled on network shares, but the usb thing is really getting annoying. Thanks!

Posted on Jun 5, 2008 8:34 AM

Reply
18 replies

Jun 5, 2008 10:18 AM in response to NoSmokingBandit

The "movie.mp4" and "._movie.mp4" are what's called an AppleDouble file pair. The file data is stored in "movie.mp4" and the file metadata is stored in the "resource fork", "._movie.mp4". When read back in, the Mac system knows that the ._movie.mp4 file provides information about the movie.mp4 file, and reconstructs the information it needs. This is completely transparent to you.

You will see AppleDouble files anytime an app on your Mac wants to write resource fork information onto a filesystem that doesn't understand resources forks. Typically you'll see this over NFS to non-Mac NFS servers.

My guess is that your PSP (is that the Playstation portable?) has a filesystem on it that isn't HFS+ or NTFS (same with whatever you're connecting via USB).

Jun 5, 2008 10:27 AM in response to glsmith

Yes, PSP = Playstation Portable 😀
The filesystem it uses is either Fat16 or Fat32 (i always format to fat32).
So is there a way to keep osx from littering my memory stick with metatdata files? Linux and Windows manage to keep my drives clean of crap (minus the occasional Thumbs.db from windows) and it would be nice is leo could not leave junk all around.

Jun 5, 2008 10:29 AM in response to NoSmokingBandit

You can use this terminal command to get rid of the ._movie.mp4 files with these steps.
1. Open /Applications/Utilities/Terminal.
2. Type: dot_clean -n

3. DON'T press enter yet.
4. Type a space, then drag the PSP's icon into the Terminal window. You'll see some text appear.
Press enter.
When the prompt (looks like: Computername:~ username$) appears, you can quit Terminal, and it'll be all cleaned up.

Note: You'll have to do that every time you sync your PSP, since that just removes them.

Good luck!

Message was edited by: joshz

Message was edited by: joshz

Jun 5, 2008 10:40 AM in response to joshz

The way i take care of it now is via a Automator plugin that shows/hides the hidden files. Then I erase them by hand. I was just hoping there would be a way to tweak finder to do this automatically.

I suppose i could take your terminal commands and make an automator plugin out of it. Then i could add a line after that to unmount the drive. Then i just run the plugin via finder and it would clean and unmount the drive.
Hmmm, ill give that a try. Thanks. :P

Jun 5, 2008 10:48 AM in response to NoSmokingBandit

Well, I wouldn't say that data is "crap". The metadata is supposed to make your computing experience that much better. It's certainly worked for you 😉

There is no way (that I know of) to stop the system from writing these files unfortunately. Some of the other posts in this thread on how to get rid of those files is probably your best bet...

Message was edited by: glsmith

Jun 5, 2008 11:00 AM in response to NoSmokingBandit

there is no way to do that automatically. as was explained those files are resource forks used by HFS+ and not junk.

I've written an apple script a while back for someone with the same request.
here it is if you want to use it.
paste it into Script Editor and save it as an application. (An automator workflow will work too).
\\

<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #ADD8E6;
overflow: auto;"
title="this text can be pasted into the Script Editor">
on open some_items
repeat with this_item in some_items
try
set ppath to quoted form of (POSIX path of this_item)
do shell script "dot_clean --keep=dotbar " & ppath
do shell script "diskutil eject " & ppath & ">dev/null&"

end try
end repeat
end open</pre>

\\
when you want to eject your thumb drive drop the drive onto the application icon.

It will delete all the . files and eject the drive.

Jun 5, 2008 11:03 AM in response to NoSmokingBandit

I guess the other option you have, which may be less work for you in the long run, is to simply use a copy tool that allows you to not copy resource fork information if you don't want/need them. For example, the "ditto" command has a --norsrc option that does just that.

You'd have to do your copying from the command line rather than the Finder, but I suppose you could make some kind of Automator script or AppleScript script accessible via the GUI that runs ditto under the hood...

Jun 5, 2008 12:45 PM in response to V.K.

I suppose that script^^ will have to do. It takes about 5 seconds to unmount though...
The resource forks are useful, i am aware of that, but the way osx uses them isnt ideal. In linux everything is kept in the users home folder so there arent "hidden" files strewn about.
I tried some folder actions, but it seems as though they dont work on the root of a drive. Im not sure how to make them work on subfolders anyway...
Thanks for the help though, i appreciate it.

Jun 5, 2008 1:14 PM in response to NoSmokingBandit

The only reason there are hidden files is because your filesystem can't handle the metadata. Those dot files don't exist in your Mac directories, or on any HFS+ filesystem. Also, afaik, Linux doesn't even have the concept of "resource forks", so I'm not sure what you're referring to. Extended attributes, yes, but not forks.

If you are copying data to your PSP (rather than having an application write data directly to the PSP), then just use the CLI to copy only the data fork...

Jun 5, 2008 1:57 PM in response to glsmith

Sorry, but i think its stupid to have to use the terminal just to move some files around.
Its frustrating that osx feels the need to write its own metadata everywhere even if its not an HFS+ disk.
I have found a app called "BlueHarvest" that takes care of what i wanted. Its got a 30 day trial, hopefully by then i find a free alternative for it. Maybe apple will buy this guys app to integrate into 10.5.6. I hope so, it would make multi-OS environments much nicer.

Jun 5, 2008 2:24 PM in response to NoSmokingBandit

So you'd rather have decreased functionality in favor of not writing dot files to filesystems that don't understand HFS+ metadata? Personally I think the use of AppleDouble is a rather elegant way to maintain a consistent user experience across a wide range of filesystem types. But then I'm also of the opinion that the CLI is usually a faster way to get done what I want to get done, so I guess to each his own...

Jun 5, 2008 6:32 PM in response to glsmith

I didnt mean to sound snappy. I just think it would be nice to have an option to not leave metadata files laying around on a drive where they arent really useful. On a thumb drive that is used for constantly reading/writing/transferring files i would want to keep them, but on my psp the extra files are less than useless.
I would be happy with just one .DS_Store file in the root of the drive (since no device would recognize a ds_store file anyway) that tells finder whether or not to include anything more than just the data file.
Hopefully in 10.6 😀

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Hidden file woes...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.