to add to the existing answers... consult the docs
>perldoc -q rename a file
Found in perlfaq5.pod
How can I reliably rename a file?
Well, usually you just use Perl's rename() function. That may
not work everywhere, though, particularly when renaming files
across file systems. Some sub-Unix systems have broken ports
that corrupt the semantics of rename()--for example, WinNT does
this right, but Win95 and Win98 are broken. (The last two parts
are not surprising, but the first is. :-)
If your operating system supports a proper mv(1) program or its
moral equivalent, this works:
rename($old, $new) or system("mv", $old, $new);
It may be more compelling to use the File::Copy module instead.
You just copy to the new file to the new name (checking return
values), then delete the old one. This isn't really the same
semantically as a real rename(), though, which preserves
metainformation like permissions, timestamps, inode info, etc.
Newer versions of File::Copy exports a move() function.
~Particle *accelerates*
In reply to Re: The Office suite and long file names
by particle
in thread The Office suite and long file names
by Necos
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |