Skip to content

movefile

miscellaneous · scripts/miscellaneous/movefile.m

: movefile (source, destination)
: movefile (source, destination, "f")
: [status, message, messageid] = movefile (…)

Move or rename files and folders.

The arguments, the wildcard patterns and the outputs are those of copyfile, except that the source no longer exists afterwards. A file moved to a new name is renamed, one moved to an existing folder ends up inside it, and an existing file of the same name is replaced.

Moving something onto itself, a folder into itself, or anything to a folder that does not exist fails. When several sources are given, the ones that do not exist are skipped.