Navigation

Operators and Keywords

Function List:

C++ API

: movefile (f1)
: movefile (f1, f2)
: movefile (f1, f2, 'f')
: [status, msg, msgid] = movefile (…)

Move the source files or directories f1 to the destination f2.

The name f1 may contain globbing patterns. If f1 expands to multiple filenames, f2 must be a directory. If no destination f2 is specified then the destination is the present working directory. If f2 is a filename then f1 is renamed to f2.

When the force flag 'f' is given any existing files will be overwritten without prompting.

If successful, status is 1, and msg, msgid are empty character strings (""). Otherwise, status is 0, msg contains a system-dependent error message, and msgid contains a unique message identifier. Note that the status code is exactly opposite that of the system command.

See also: rename, copyfile, unlink, delete, glob.

Package: octave