Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Avoiding ._ filenames when copying files System
It is my understanding that when copying files from X to a drive formatted that doesn't have resource forks, a "._filename" file is created that holds the information. While this is apparently very important if you plan to move the file back, sometimes having that file can be in a pain.

On my Kodak MC3 digital camera/MP3 player, when copying files to it's music folder on the compactflash card via the finder, it creates "._filename" files that cause the camera to freeze for long periods of time when it encounters them. I found there was no way to delete them in X. However, after fooling around a bit in the Terminal, I found that using the 'mv' and 'cp' commands will move or copy files to the compactflash card without the ._ files.

And of course, if you don't like the terminal, an applescript studio app could be made relatively simple to copy these files with the cp or mv function, which is what I did to solve my own issue.

[Editor's note: For the newcomers to OS X, it's very important to note that if you wish to retain your resource fork information, you should NOT use this method of copying files from the Terminal! But it can be useful when transferring files to systems that don't understand resource forks.]
    •    
  • Currently 1.67 / 5
  You rated: 1 / 5 (3 votes cast)
 
[20,462 views]  

Avoiding ._ filenames when copying files | 12 comments | Create New Account
Click here to return to the 'Avoiding ._ filenames when copying files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
WIndows and
Authored by: Chummer- on Feb 17, '02 01:19:30PM

I have a computer running Windows XP for my fileserver. These files are annoying when they are created in my MP3 stash... They get transferred to my playlists in Windows and just generally clutter up the file views.

In windows there is a control panel that allows you to assign filetypes to extensions which I've messed around with but I cannot figure out how to make the files invisible in windows. Does anyone out there know of a solution to hiding these files from windows that does not require going through all of the directories and manually deleting them?

Any hints on this subject would be appreciated.



[ Reply to This | # ]
Link to Applescript Studio Project?
Authored by: kollivier on Feb 18, '02 11:26:57AM

Any possibility we could get a link to the Applescript Studio project you created? I'm actually in the process of "moving" from Windows to Mac and as such I do a lot of file sharing so this app would be very helpful. (I've also been curious about learning Applescript so this would be a nice example for me to look over.) Thanks in advance!



[ Reply to This | # ]
Re: Link to Applescript Studio Project?
Authored by: kowe on Feb 19, '02 04:23:09PM
I put the project and applescript studio app up at: http://benn.vectorx.org/cptocf/ Benn.

[ Reply to This | # ]
Hidden files bad
Authored by: johnmont on Feb 18, '02 12:29:56PM

This is a really frustrating aspect of OSX.

I really don't think the system should be dropping these hidden files on non-native mounts such as NFS and SMB volumes. When I copy a file from my unix machine or a Windows machine to the Mac, it doesn't leave any extra information. This really points out the limitations of the current tracking of metadata (resource fork stuff) in OS X.

My sysadmins really don't like seeing all of these additional files being left on unix machines and especially Windows servers. I hope this issue can be addressed in the future.

It's really pretty bush-league and arrogant on Apple's part. Arrogant? Apple? Really? ;-) [vbg]



[ Reply to This | # ]
Hidden files bad
Authored by: zadak on Feb 18, '02 03:37:41PM

Anyone making a fix for this problem is gonna get a wet kiss from me.
I truly hate this as I work with win-servers at work and my co-workers get pissed at the junkfiles laying around.



[ Reply to This | # ]
script solution
Authored by: macubergeek on Feb 18, '02 06:58:09PM

Hi I frequently mount a share from my winNT box to my macos X box and I have solved this problem with the following script that I run on the Mac as a cron job, running every minute

#!/bin/sh
if ls pcshare
then
rm -R /Volumes/pcshare/.Trashes
rm /Volumes/pcshare/'._.Trashes'
rm /Volumes/pcshare/'.DS_Store'
fi



[ Reply to This | # ]
script solution
Authored by: zadak on Feb 19, '02 05:04:45AM

how do you set up a cron job?
is this totally safe to do?

:)


roger



[ Reply to This | # ]
Limewire leaves dot orphans too
Authored by: tochoa on Feb 18, '02 07:48:14PM

I noticed the dot files while using Limewire - I would click into the "Incomplete" folder in the finder, and I would see a file show up, then disappear. That was a little curious, so I surfed the directory with terminal; there were tons of dot files there. By trial and error, I discovered that a dot file was being left behind every time I opened a download in progress, then was left behind in the Incomplete folder when Limewire moved the download to my downloads folder.
When moving files in Terminal that you _want_ the dots to accompany, use the latest dev tools and add the path /Developer/Tools to your login script. Then you can use CpMac and MvMac, which properly preserve the data fork. Limewire doesn't, so if you're using it clean up your Incomplete folder once in a while. (Reported to Limewire as bug as well).
TonyO



[ Reply to This | # ]
._ Filenames Droplet
Authored by: Joshua on Feb 19, '02 06:57:39PM

I have the same problem with my new HipZip Mp3 Player.
So I have realized a little droplet with Applescript that delete all ._ files and then eject the disk.
Using this Droplet is very easy: you just have to drag the ._ "infected" disk on the Droplet.

Here is the code:

--Begin
on open cdisk
set disco to name of (info for cdisk)
try
do shell script "rm /Volumes/" & disco & "/._*"
end try
tell application "Finder" to eject cdisk
end open
--End

A ready-to-use Droplet is available here:

http://web.tiscalinet.it/thinkdifferent/HipDisk.sit



[ Reply to This | # ]
._ Filenames Droplet
Authored by: LaRoche02 on Apr 20, '02 07:57:35PM

Wow, I'm really glad I found this thread. I've been having problems using my mp3 jukebox with OSX for this reason. My problem is, the droplet doesn't seem to work. I think it is only deleting the res forks in the root directory, when I have a hiearchy of /artists/albums/files.mp3. How can I vary the script to look for res forks in all of the directories?

Thanks,
LaRoche



[ Reply to This | # ]
._ Filenames Droplet
Authored by: serversurfer on Apr 20, '02 11:54:12PM
Just change the 'do shell script' line to read
do shell script "rm -rf /Volumes/" & disco & "/._*"
This will cause the rm command to recurse through directories looking for files that start with '._' The -r flag means recurse and the -f (force) flag means remove the file even if they are not 'writable' and ignore non-existent files. (Obviously, non-existent files aren't a issue ion this case, but we want to kill all the ._'s even if they aren't writable.)

Love,
The Surfer

[ Reply to This | # ]
._ Filenames Droplet
Authored by: fracai on Jun 23, '05 03:34:07PM

-r doesn't really mean search recursively. what it does mean is if a folder matches then that folder and it's contents should be removed

in order to actually recurse you'd want to use something like:

find ./ -iname "._*" -exec rm -rf -- {} \;

this will find anything that starts with ._ and remove it, folders and files.

---
i am jack's amusing sig file



[ Reply to This | # ]