diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2003-02-05 11:36:13 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2003-02-05 11:36:13 +0000 |
commit | e6ef3a7589e3cd0116237aac21548402d885fc9a (patch) | |
tree | bf5d2593f40291a3c8ffa21586a2136327863aac /sysutils/whatpix/files/patch-whatpix | |
parent | Update to 1.1 (diff) |
New port: whatpix
a perl apps to find, moves or deletes duplicate files.
PR: ports/41480
Submitted by: Philippe CASIDY <pcasidy@casidy.com>
Diffstat (limited to 'sysutils/whatpix/files/patch-whatpix')
-rw-r--r-- | sysutils/whatpix/files/patch-whatpix | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/sysutils/whatpix/files/patch-whatpix b/sysutils/whatpix/files/patch-whatpix new file mode 100644 index 000000000000..1e154e812370 --- /dev/null +++ b/sysutils/whatpix/files/patch-whatpix @@ -0,0 +1,53 @@ +*** whatpix.ori Fri Aug 9 13:43:49 2002 +--- whatpix Fri Aug 9 13:44:49 2002 +*************** +*** 236,242 **** + print " ", $dir, "\n"; + + # Get list of subdirectories. +! opendir(DIR, $dir) or die "Error: opendir() failed on $dir\n"; + my @dirs = grep { -d "$dir/$_" } readdir(DIR); + closedir(DIR); + +--- 236,242 ---- + print " ", $dir, "\n"; + + # Get list of subdirectories. +! opendir(DIR, "$dir\0") or die "Error: opendir() failed on $dir\n"; + my @dirs = grep { -d "$dir/$_" } readdir(DIR); + closedir(DIR); + +*************** +*** 246,252 **** + } + + # Now do the files in this directory. +! opendir(DIR, $dir) || die "Error: failed to open $dir: $!"; + my @files = grep { -r "$dir/$_" && -s "$dir/$_" } readdir(DIR); + closedir(DIR); + my $digester = $usemd5 ? Digest::MD5->new() : Digest::SHA1->new(); +--- 246,252 ---- + } + + # Now do the files in this directory. +! opendir(DIR, "$dir\0") || die "Error: failed to open $dir: $!"; + my @files = grep { -r "$dir/$_" && -s "$dir/$_" } readdir(DIR); + closedir(DIR); + my $digester = $usemd5 ? Digest::MD5->new() : Digest::SHA1->new(); +*************** +*** 256,262 **** + my @vars = stat($filename) or die "Error: could not stat $filename\n"; + my $size = $vars[7]; + if ($size) { +! open(FILE, $filename) or die "Error: could not open $filename\n"; + binmode(FILE); + $digester->reset; + $digester->addfile(*FILE); +--- 256,262 ---- + my @vars = stat($filename) or die "Error: could not stat $filename\n"; + my $size = $vars[7]; + if ($size) { +! open(FILE, "$filename\0") or die "Error: could not open $filename\n"; + binmode(FILE); + $digester->reset; + $digester->addfile(*FILE); |