From bcf50c9868ecc4dd1c237bb846de36dc12c330ef Mon Sep 17 00:00:00 2001 From: Guillaume Rousse Date: Thu, 8 May 2008 16:32:03 +0000 Subject: no more call to external commands for file linking and deletions --- compress_files | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compress_files b/compress_files index bb879b7..79e0c1b 100755 --- a/compress_files +++ b/compress_files @@ -44,8 +44,8 @@ foreach my $dir (@sodirs) { } foreach my $sofile (@sofiles) { my $sodest = shift(@sodests); - system "rm", "-f",$sofile; - system "ln", "-sf",$sodest,$sofile; + unlink $sofile; + symlink $sodest, $sofile; } my @files; @@ -108,9 +108,9 @@ if (@f) { # they are again. foreach (keys %hardlinks) { # Remove old file. - system("rm", "-f", $_); + unlink $_; # Make new hardlink. - system("ln", "$hardlinks{$_}$ext", "$_$ext"); + link "$hardlinks{$_}$ext", "$_$ext"; } # Fix up symlinks that were pointing to the uncompressed files. @@ -122,11 +122,11 @@ while (<$FIND>) { my ($directory) = m!(.*)/!; my $linkval = readlink($_); if (! -e "$directory/$linkval" && -e "$directory/$linkval$ext") { - system("rm", "-f", $_); - system("ln", "-sf", "$linkval$ext", "$_$ext"); + unlink $_; + symlink "$linkval$ext", "$_$ext"; } elsif (! -e "$directory/$linkval" && ! -e "$directory/$linkval$ext" && $directory =~ m|man/|) { #Bad link go on nowhere (any better idea) ? - unlink($_); + unlink $_; } } -- cgit v1.2.1