RemoveDirectory

 

Description

This function deletes an existing empty directory.

Syntax

BOOL RemoveDirectory( LPCSTR lpPathName )

Parameters

lpPathName
[input] Pointer to a null-terminated string that specifies the path of the directory to be removed. The path must specify an empty directory, and the calling process must have delete access to the directory.

Return

Nonzero indicates success. Zero indicates failure.

Examples

EX1

int    RemoveDirectory_ex1()
{
    char    szDirPath[] = "c:\\TEXTRO\\"; 
    if (!CreateDirectory(szDirPath, NULL)) 
    { 
        out_str("Couldn't create new directory."); 
    }
    if (!RemoveDirectory(szDirPath)) 
    { 
        out_str("Couldn't Delete empty directory."); 
    }
    return 1;
}

Remark

See Also

CreateDirectory

header to Include

origin.h

Reference