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

Safely remove '._' files via an AppleScript System
The following script cleans up those pesky '._' resource fork files whenever it is safe to. I wrote it mainly for my Windows-formatted iPod, but others may find it useful, so here it is ... WinFSCleanser (macosxhints.com mirror).

The list of file types that can safely lose their resource fork are listed in the script as safe_ext, and prompted for at run time. There are so many bits and pieces of so many other scripts that I can't remember them all. So I thank you if something you did is in here.

[robg adds: There are previous hints on removing the resource fork files, but this seems like a good, all-inclusive script. Just be careful with it, as you can break programs if you delete resource forks that they rely on...]
    •    
  • Currently 1.50 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[19,575 views]  

Safely remove '._' files via an AppleScript | 12 comments | Create New Account
Click here to return to the 'Safely remove '._' files via an AppleScript' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Safely remove '._' files via an AppleScript
Authored by: zedwards on Mar 08, '05 11:34:06AM

Great! This is one of the most annoying things about having a windows server and macs using them to store files for PC users.

I am trying this out right as I type. (crossing fingers that it doesn't hose our server)



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: pauljlucas on Mar 08, '05 02:19:47PM
What's wrong with:

for ext in gif rtf doc htm html mov txt jpg
do find /Volumes/whatever -name "*._.$ext" -exec rm -f {} \;
done
AppleScript is so verbose.

---
- Paul

[ Reply to This | # ]

Safely remove '._' files via an AppleScript
Authored by: szedula on Mar 08, '05 04:02:46PM
this line:

do find /Volumes/whatever -name "*._.$ext" -exec rm -f {} \;

should be:

do find /Volumes/whatever -name "._*.$ext" -exec rm -f {} \;
 
shouldn't it?

[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: pauljlucas on Mar 08, '05 04:44:13PM
Yes; sorry.

---
- Paul

[ Reply to This | # ]

Safely remove '._' files via an AppleScript
Authored by: mike3k on Mar 08, '05 02:54:19PM

I use this on my Linux box (which I use as a NFS server):

find . -name "._*" -print -exec 'rm' '{}' ';'



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: tocoolcjs on Mar 08, '05 05:19:00PM

That is dangerous. Some files need their fork. (e.g. *.weblock)



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: digitol on Mar 08, '05 09:12:29PM

Shameless Plug: Or you can not copy the files over in the first-place using a utility I wrote called Kopymac. http://www.tcsn.net/mont



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: tocoolcjs on Mar 09, '05 07:08:17AM

BTW this script app is up to version 1.1



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: osxpounder on Mar 10, '05 03:19:59PM

Thanks, toc .... I renamed this script to "DotFileCleanser" so I'd remember what it will do for me. I must wait until I get home to test it on my MP3 player, where dot files cause a slight problem [the MP3 player tries to play them and wastes a good 20 seconds to a minute before moving on to the next].

If I run this, though, it will scrub the custom icon I added to my MP3 player, right? Or will it? I noticed that the custom icon only appeared on my office Mac, at first. I copied the Photoshop file to my home Mac, plugged in my MP3 player, pasted the new icon art into its Get Info window, and now the same icon appears on the home machine, too. This suggests that the custom icon is saved somewhere on the computer, not on the MP3 player. Do you think that's right?

---
--
osxpounder



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: osxpounder on Nov 01, '05 02:23:00PM

Sorry it's taken me so long to follow up. Just wanted to confirm that this script works wonderfully [I just add an .mp3 extension to the dialog box as it runs] and does just what I wanted: gets rid of all the "._blah.mp3" files on my i-bead 200 mp3 player. That player is great, btw.

Thanks so much!

---
--
osxpounder



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: reidspice on Nov 27, '05 11:32:41PM

the link at the top of this post is dead and, because it still ranks high in google, i thought it would be helpful to link to the latest version as it's now at 2.1:

http://www.versiontracker.com/dyn/moreinfo/macosx/26028

i'm pleased to report that it just cleaned over 1,000 of these nasty little files from a windows raid i have mounted over smb. excellent.

one note: be careful with the path/volume name as i had mine mounted by IP address and the volume, in this case, needed to be the IP address of the server (not the name of the share that shows up in the finder). had to go to the terminal to figure that one out.



[ Reply to This | # ]
Safely remove '._' files via an AppleScript
Authored by: valveman47 on May 10, '06 03:40:06AM

Hi
Any reason why it's not working for me?
OS 10.4.5.

I choose the correct folder, permissions set to read & write, hit the Cleanse button, the progress bar moves along and gives completed message.
I drag & drop the folder onto the network windows (WIN2K) server icon.
Openining the folder on the windows server and all those files are still there.
Regards



[ Reply to This | # ]