At 12:13 PM 5/9/01 -0500, Shawn wrote:
>I just want an efficient mv subroutine or module which has such a thing,
>but none of the File::* things seem to have mv.
>
>I would rather not shell out 10000 times just to, in the vast majority
>of cases, move a file from on dir to another in the same fs.
>
>Can someone help?
% perldoc -f rename
rename OLDNAME,NEWNAME
Changes the name of a file; an existing file
NEWNAME will be clobbered. Returns true for
success, false 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 mv command
sometimes compensates for this. Other
restrictions include whether it works on
directories, open files, or pre-existing files.
Check the perlport manpage and either the
rename(2) manpage or equivalent system
documentation for details.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com