DeleteFile
DeleteFile [/I/M=messageStr /P=pathName /Z ] [fileNameStr ]
The DeleteFile operation deletes a file on disk.
Parameters
fileNameStr can be a full path to the file to be deleted (in which case /P is not needed), a partial path relative to the folder associated with pathName, or the name of a file in the folder associated with pathName.
If Igor cannot determine the location of the file from fileNameStr and pathName, it displays a dialog allowing you to specify the file to be deleted.
If you use a full or partial path for either file, see Path Separators for details on forming the path.
Flags
| /I | Interactive mode. The Open File dialog will display even if fileNameStr is specified and the file exists. | ||||||
| /M=messageStr | Specifies the prompt message in the Open File dialog. | ||||||
| /P=pathName | Specifies the folder to look in for the file. pathName is the name of an existing symbolic path. | ||||||
| /Z[=z ] | Prevents procedure execution from aborting if it attempts to delete a file that does not exist. Use /Z if you want to handle this case in your procedures rather than having execution abort. | ||||||
| |||||||
Variables
| The Delete operation returns information in the following variables: | ||
| V_flag | Set to zero if the file was deleted, to -1 if the user cancelled the Open File dialog, and to some nonzero value if an error occurred, such as the specified file does not exist. | |
| S_path | Stores the full path to the file that was deleted. If an error occurred or if the user cancelled, it is set to an empty string. | |