upload.pl
branchonce
changeset 29 aebcf858b3b0
parent 28 27622a0a492e
child 30 e3f90a124398
equal deleted inserted replaced
28:27622a0a492e 29:aebcf858b3b0
   122         mkdir $dir, 0750 or die "Can't mkdir $dir: $!\n";
   122         mkdir $dir, 0750 or die "Can't mkdir $dir: $!\n";
   123         my $outfh = new IO::File ">$dir/$filename"
   123         my $outfh = new IO::File ">$dir/$filename"
   124           or die "Can't create $dir/$filename: $!\n";
   124           or die "Can't create $dir/$filename: $!\n";
   125         print {$outfh} <$file>;
   125         print {$outfh} <$file>;
   126 
   126 
   127         if (my $atfh = new IO::File("|at now + $days days")) {
   127         if (not $delete ~~ [qw(d m)]  and my $atfh = new IO::File("|at now + $days days")) {
   128             print {$atfh}
   128             print {$atfh}
   129               "rm -f \"$dir/$filename\"\n",
   129               "rm -f \"$dir/$filename\"\n",
   130               "rmdir \"$dir\"\n";
   130               "rmdir \"$dir\"\n";
   131             close $atfh;
   131             close $atfh;
   132             system("cat /tmp/log");
   132             system("cat /tmp/log");