DeleteFile

Prototype

Matrix DeleteFile( String sPathName )

Return Value

The return value is 1 on success or 0 on failure.

Parameters

String sPathName
The directory path and filename of the file to be deleted.

Remarks

This module deletes a file. The file must be accessible to the Windows operating system of the client computer. The module calls the Windows function DeleteFile to delete the file.

Example
declare DataObject dobj;
x = 1:10;
dobj = DataObject.Create( "Sample", x );
run GetPersonalFilesDirectory( path );
pathname = path + "Data Sets\_DeleteMe_.sas7bdat";
dobj.WriteToFile( pathname );
ok = DeleteFile( pathname );
if ok then
    print "OK";
else
    print "Function failed";