Sets the file name of a file.
Scope: File
Syntax
query name
set name Filename
Option
Filename |
The new name and path of the file in the Directory/Filename format. The path may be absolute or relative to the current directory. |
Description
The name parameter changes the filename of the current file. If the filename does not already exist, a new file will be created.
The Editor accepts a name with any syntax but a file without a valid file name cannot be saved by a simple save or file command.
Example
To change the name and directory of a file, type:
set name /lpex/newfile.c
set name \lpex\newfile.c
When the file is reloaded, the C parser is used because the .c extension was specified in the new file name.
API Return Codes
1 |
The filename already exists. |
-1 |
The filename is not valid. |
-6 |
The Editor encountered an error when the file was being saved. |
-7 |
The file was not saved because the nosave parameter is set to on. To save the file, set the nosave parameter to off, and then use either the file or save command to save the file. |
![]()
