Jeff Westman wrote:

> Why doesn't my rename() work?  It is returning a '1', meaning success (I get
> the "has been modified" message below.  Yet when I list the files (ls), it
> shows the original file name and my tmp file name.  The rename doesn't seem
> to work.
>
> Any ideas?!
>
>     ....
>     close(IN)  or warn "cannot close file $inFile: $!\n";
>     close(TMP) or warn "cannot close file $tmpFile: $!\n";
>     ....
>     $rc = rename($tmpFile, $inFile) or die "Could not rename files: $!\n";
>     print "RC = $rc\n";
>     if (! $rc) {
>         warn "Rename failed:  $!\n";
>     }
>     else {
>         print "File $inFile has been modfied\n";
>     }
>
> -Jeff

Hi Jeff,

The code you have looks fine, presuming both fiiles are in the current directory.  It 
might help to see more of the context.  Have you tried pritning both filenames, as 
well as checking the tmp file before and after running the script to ensure that it 
has been modified?

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to