Description

Deletes an operating system file.

Syntax

OSDelete file

Parameters

The OSDelete statement has the following parameters.

ParameterDescription
fileThe 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:

ValueMeaning
0No error.
1Bad OS filename.
2Access denied by operating system.
3Disk or directory full.
4File does not exist.
5Unknown error.
6Attempt 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

OSBReadOSBWriteOSCloseOSOpenOSReadOSWrite

Example

/* Delete an operating system file */
 
filename = "c:\temp\my_data.txt"
OSDelete filename
errCode = status()
  • No labels