User Tools

Site Tools


uphp:functions:rename

rename

WMPRO, WMMINI FW >= 1.0 WMMEGA FW >= 2.0

Rename or move a file or directory from source to destination

Description

int rename ( string $source, string $destination )

This function attempts to rename or move a file or directory from source to destination, moving it between directories if necessary. Relative paths are supported for both parameters: using a / at the beginning will make it relative to the root, otherwise it will be relative to the current working directory, which is either the folder that the script was started in or as was set by chdir().

Parameters

$source: File or directory to be renamed or moved

$destination: The new path and/or name

Return Values

Integer: 0=success, otherwise error code

See Also

chdir() - Change the current directory

getcwd() - Get the current directory

mkdir() - Make a directory

rmdir() - Remove a directory, with optional deletion of contents

unlink() - Remove a file (delete it)

uphp/functions/rename.txt · Last modified: 2021/09/13 05:57 (external edit)