- //if (dirEnt.d_name[0] == '.')
- //{
- // goto SKIP_DIR;
- //}
-
- // prepare entry path
- dirEntryPath.Append(__absoluteDirPath);
- dirEntryPath.Append(L"/");
- dirEntryPath.Append(dirEnt.d_name);
- unique_ptr<char[]> pAbsDirEntryPath(_StringConverter::CopyToCharArrayN(dirEntryPath));
- SysTryReturn(NID_IO, (pAbsDirEntryPath != null), GetLastResult(), GetLastResult(),
- "[%s] Invalid argument was passed. Given pattern length is not correct!", GetErrorMessage(GetLastResult()));
-
- // get its details
- ret = stat64(pAbsDirEntryPath.get(), &statbuf);
- SysSecureTryReturn(NID_IO, (ret == 0), r = __ConvertNativeErrorToResult(errno), __ConvertNativeErrorToResult(errno),
- "[%s] Failed to get attributes for dir entry (%s) whose absolute dirpath is (%s)with errno [%d].",
- __ConvertNativeErrorToMessage(errno), dirEnt.d_name, pAbsDirPath.get(), errno);
+ struct stat64 statbuf;
+ int ret = stat64(entryPath, &statbuf);
+ SysSecureTryReturnResult(NID_IO, ret == 0, r = __ConvertNativeErrorToResult(errno),
+ "[%s] Failed to get attributes for directory entry (%s), errno: %d (%s)",
+ entryPath, errno, strerror(errno));