Show/Hide Toolbars

XSharp

NoteThis command is defined in a header file and will be preprocessed by the X# preprocessor to a function call. If you disable the standard header (-nostddefs) files then this command will not be available. If you tell the compiler to use a different standard header file (-stddef ) then this command may also be not available

Purpose

Remove a file from disk.

Syntax

DELETE FILE | ERASE <xcSourceFile>

Arguments

<xcSourceFile>The name of the file to delete, including an optional drive, directory, and extension.  SetDefault() and SetPath() do not affect this command.  It assumes the current Windows drive and directory if none is specified.  No default extension is supplied.
 
Warning!  Files must be closed before deleting them.

Examples

This example removes a specified file from disk then tests to see if the file was removed:

 

? File("temp.dbf")                // Result:  TRUE
DELETE FILE temp.dbf
? File("temp.dbf")                // Result:  FALSE

Assembly

XSharp.Core.DLL

See Also

CurDir(), FErase(), File(), USE, SetDefault(), SetPath()