> ----- Original Message -----
> From: "Chris Zampese" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, February 10, 2002 12:57 AM
> Subject: rename a file in win98
>
>
> Just wondering if anyone has any bright ideas on how to rename a file in
> Win98. I have tried the following...
>
> my $old="C:/sentslips/sentslipstemp.txt";
> my $new="C:/sentslips/sentslips1.txt";
>
> rename($old, $new);
>
> But no luck, the sctipt runs without errors (I am running with the -w
switch
> and use strict)
>
> Thanks for your help,
> Chris
I have also tried using File::Copy but it doesnt copy the last line of the
file.
My file is created by printing single lines into a text file as follows....
open($MYFILE1, "+>> C:/sentslips/sentslipstemp.txt")
|| die "can't open C:/sentslips/sentslipstemp.txt";
print {$MYFILE1} "$filename?$date\n";
close (MYFILE1);
This is inside a loop, so I end up with a file with (at the moment) 2-4
lines like so...
Placing_Slip___This is the first?09-02-2002
Placing_Slip___This is the second?09-02-2002
but when I copy or move the file like this...
copy("C:/sentslips/sentslipstemp.txt","C:/sentslips/sentslips1.txt");
the new file would have one less line,
any help would be hugely appreciated. Thanks again
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]