DeleteFile

 

Description

Delete an existing file.

Syntax

BOOL DeleteFile( LPCTSTR lpFileName )

Parameters

lpFileName
[input] null-terminated string that specifies the file to be deleted.

Return

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero.

Examples

EX1

int DeleteFile_ex1()
{
    string str = "c:\\mytempfile.txt"; 
    if( DeleteFile(str) )
        printf("%s deleted\n", str);
    else
        printf("%s was not deleted\n", str);
    return 1;
}

Remark

Delete an existing file.

See Also

header to Include

origin.h

Reference