Ejemplo n.º 1
0
BOOL CreatePath(CTSTR lpPath)
{
    if(OSFileExists(lpPath))
        return true;
    if(OSCreateDirectory(lpPath))
        return true;
    else
        if(!CreatePath(GetPathDirectory(lpPath)))
            return false;
    return OSCreateDirectory(lpPath);
}
BOOL CreatePath(CTSTR lpPath)
{
    if(OSFileExists(lpPath))
        return true;
    if(OSCreateDirectory(lpPath))
        return true;
    else
    {
        String parent = GetPathDirectory(lpPath);
        if (parent == lpPath)
            return false;
        if (!CreatePath(parent))
            return false;
    }
    return OSCreateDirectory(lpPath);
}