rename
Renames a file or directory
&reftitle.description;
boolrename
stringoldname
stringnewname
resourcecontext
Attempts to rename oldname to
newname, moving it between directories if necessary.
If newname exists, it will be overwritten.
&reftitle.parameters;
oldname
The old name. The wrapper used in oldname
must match the wrapper used in
newname.
newname
The new name.
context
¬e.context-support;
&reftitle.returnvalues;
&return.success;
&reftitle.changelog;
&Version;
&Description;
5.3.1
rename can now rename files across drives in
Windows.
5.0.0
rename can now also be used with
some URL wrappers. Refer to for a listing of which wrappers
support rename.
4.3.3
rename may now be able to rename files across
partitions on *nix based systems, provided the appropriate permissions
are held. Warnings may be generated if the destination filesystem
doesn't permit chown() or
chmod() system calls to be made on files —
for example, if the destination filesystem is a FAT filesystem.
&reftitle.examples;
Example with rename
]]>
&reftitle.seealso;
copy
unlink
move_uploaded_file