Replace
#define APP_DATA_DIR_CHILD_2 "./child2"
g_nResult = GetFileAttributes((wchar_t*)APP_DATA_DIR_CHILD_2);
By (if Unicode is defined)
#define APP_DATA_DIR_CHILD_2 L"./child2"
g_nResult = GetFileAttributes(APP_DATA_DIR_CHILD_2);
Your code is far away of portable... Use stat instead
struct stat sts;
if ( stat(APP_DATA_DIR_CHILD_2, &sts) != 0) {
// Fail to get info about the file, may not exist...
}
else {
if (S_ISDIR(sts.st_mode)) { /* The file is a directory... */ }
}
Take a look at the documentation : http://linux.die.net/man/2/stat