# OSDELETE

Updated: 10/19/2021, 9:29:48 PM
Created: 10/19/2021, 9:29:48 PM
Last Updated By: Kevin Munoz
Read Time: 1 minute(s)

Tags: file handling

# Description

The OSDELETE command deletes a NT or UNIX file. It takes the general form:

OSDELETE filename [ON ERROR statements]
1

Where:

  • filename Specifies the file to delete. filename must include the file path. If the path is not specified, jBASE searches the current directory.
  • ON ERROR statements Specifies statements to execute if the OSDELETE statement fails with a fatal error because the file is not open, an I/O error occurs, or jBASE cannot find the file.

If the ON ERROR clause is not specified and a fatal error occurs, the program terminates.

After executing OSDELETE, the STATUS function returns either 0 or a failure code.

Code Description
0 The file was deleted
1 Delete failed.

An example of use is the program statement to delete the file ‘MYPIPE’ in the current directory:

OSDELETE "MYPIPE"
1

Go back to jBASE BASIC

Go back to Programmers' Reference Guide