Description
Deletes an operating system file.
Syntax
OSDelete file
Parameters
The OSDelete statement has the following parameters.
Parameter | Description |
---|---|
file | The name of the operating system file (including drive or directory path, filename, and extension) to be deleted. |
Returns
After the execution of an OSDelete statement, the Status() of the delete is returned with one of the following codes:
Value | Meaning |
---|---|
0 | No error. |
1 | Bad OS filename. |
2 | Access denied by operating system. |
3 | Disk or directory full. |
4 | File does not exist. |
5 | Unknown error. |
6 | Attempt to write to a read-only file. |
Note: You should first close any file to be deleted. For more information, refer to OSClose.
See Also
OSBRead, OSBWrite, OSClose, OSOpen, OSRead, OSWrite
Example
/* Delete an operating system file */ filename = "c:\temp\my_data.txt" OSDelete filename errCode = status()