CheckMakePath

 

Description

Check the given path to see if is existed, if not, then create all the needed folders

Syntax

BOOL CheckMakePath( LPCSTR lpcszFullPath )

Parameters

lpcszFullPath
[input] full path string to check for making folders

Return

TRUE if either the path already existed (can call string::IsPath if don't want to waste time).

FALSE if error occurs when attempting to create the needed folders

Examples

EX1

void    CheckMakePath_ex1()
{
    string    str = GetAppPath() + "junk\\some more junk";
    ASSERT(!str.IsPath());
    if(CheckMakePath(str))
    {
        ASSERT(str.IsPath());
    }
    else
        out_str("err in creating path");
}

Remark

See Also

string::IsPath

header to Include

origin.h

Reference