> 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?!
Any of this apply??
perldoc -f rename
=item rename OLDNAME,NEWNAME
Changes the name of a file. Returns C<1> for success, C<0> otherwise.
Behavior of this function varies wildly depending on your system
implementation. For example, it will usually not work across file system
boundaries, even though the system I<mv> command sometimes compensates
for this. Other restrictions include whether it works on directories,
open files, or pre-existing files. Check L<perlport> and either the
rename(2) manpage or equivalent system documentation for details.
You may just try using backticks to execute mv
DMuey
>
> ....
> 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
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]