M MY Multiplayer: Wiki
Side
Kind

fileRename

Shared

Renames or moves a file within the calling resource. Folders missing at the destination are created.

bool fileRename(string from, string to)

Parameters

NameTypeDescription
fromstringThe file. A path inside the calling resource.
tostringThe new path. A path inside the calling resource.

Returns

true if it worked; false if the source is not a file or the destination already exists.

A path may not contain .., \ or :, nor start with /. Another resource's files can only be read; an invalid path logs a warning and the function returns false.

Example

fileRename("logs/today.txt", "logs/yesterday.txt")

See also