#!/usr/bin/perl -w # ################################################################### # # Name: removeDSstore.pl # Version: 1.1 # Author: Pete # Author-Email: pete@rasterweb.net # Date Created: 08.07.2002 # Date Modified: 08.28.2002 # Purpose: cleans up those pesky .DS_Store files that Mac OS X # likes to make... it just ain't unix-like! # # # This is free software, you may use it and distribute it under the # same terms as Perl itself. # #################################################################### use File::Find; $File::Find::dont_use_nlink = 1; # fix for Windows shares $dir = shift(@ARGV); if ($dir eq "") { print "\n usage: perl removeDSstore.pl /path/to/some/directory\n\n"; exit; } @dirs = ($dir); find(\&deletefiles, @dirs); ################### # subs below here # #################################################################### #################################################################### sub deletefiles { my $file = $File::Find::name; my $dir = $File::Find::dir; if ($file =~ /\.DS_Store$/) { unlink $file; print "Removing: $file\n"; } } # end sub deletefiles __END__