L
Leon Heller
Guest
Although I developed this for the Pulsonix PCB software I use, and posted
details to the Pulsonix Users Group, it will probably be useful for any
other design package that creates lots of backups and report files that
clutter up design directories and waste a lot of space.
I put each design in a separate sub-directory in a top-level
directory called 'PCB'. All the design directories get cluttered with
unwanted backup, security and report files, which waste a lot of
space. I've filched some PERL code I found on the Web for recursively
walking a directory tree and modified it so that it deletes all the
above files from each sub-directory:
#!/usr/bin/perl
use File::Find;
use strict;
my $directory = "c:/pcb";
find (\&process, $directory);
sub process
{
# Find files for deleting
if ( ($File::Find::name =~ /\bBackup\b/) or
($File::Find::name =~ /\bSecurity\b/) or
($File::Find::name =~ /\.txt$/) )
{
print $File::Find::name;
print "\n";
unlink $File::Find::name;
}
}
I don't like PERL very much, I'll try rewriting it in Python.
Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller
details to the Pulsonix Users Group, it will probably be useful for any
other design package that creates lots of backups and report files that
clutter up design directories and waste a lot of space.
I put each design in a separate sub-directory in a top-level
directory called 'PCB'. All the design directories get cluttered with
unwanted backup, security and report files, which waste a lot of
space. I've filched some PERL code I found on the Web for recursively
walking a directory tree and modified it so that it deletes all the
above files from each sub-directory:
#!/usr/bin/perl
use File::Find;
use strict;
my $directory = "c:/pcb";
find (\&process, $directory);
sub process
{
# Find files for deleting
if ( ($File::Find::name =~ /\bBackup\b/) or
($File::Find::name =~ /\bSecurity\b/) or
($File::Find::name =~ /\.txt$/) )
{
print $File::Find::name;
print "\n";
unlink $File::Find::name;
}
}
I don't like PERL very much, I'll try rewriting it in Python.
Leon
--
Leon Heller, G1HSM
http://www.geocities.com/leon_heller