Do you think this will work for what the OP wanted? It tried hacking it to open two files and read from the original and write to the new one.my $mode = "0755"; my $localfile = "$uploaddir/$filename"; # open a new file and transfer bit by bit from what's in the buffe +r open( SAVED, ">>$localfile" ); while ( my $bytesread = read( $remotefile, my $buffer, 1024 ) ) { print SAVED $buffer; } close SAVED; chmod $mode, "$localfile"; # or die "can't chmod: $!";
my $mode = "0755"; my $localfile = "$uploaddir/$filename"; my $newfile = "$uploaddir2/$filename"; # open original file open( SAVED, ">>$localfile" ); # open new file open( NEW, ">$newfile" ); # write the original file to the new filename while ( my $bytesread = read( $remotefile, my $buffer, 1024 ) ) { print NEW $buffer; } close(SAVED); close(NEW); chmod $mode, "$newfile"; # or die "can't chmod: $!";
In reply to Re: moving files from folder1 to folder2
by Anonymous Monk
in thread moving files from folder1 to folder2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |