Contents Previous Next Subchapters

Renaming A File
Syntax mvfile(old name,  new name)
See Also exists , rmfile

Description
Changes the name of the file specified by old name to new name, where old name and new name are character row vectors. If either of the files is currently open for reading or writing it is closed before the operation is performed. If the name change is successful, the logical scalar true is returned, otherwise the logical scalar false is returned.

Example
If the file TEMP.OMS exists in the current working directory ( cwd ), and you enter
     mvfile("temp.oms", "junk.oms")
O-Matrix will respond
     T
If you then enter
     exists("junk.oms")
O-Matrix will respond
     T

Reference
If there already is a file with the same name as specified by new name, the move will fail and mvfile will return false.