mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-12-28 00:18:23 +00:00
fs::dir::get_first fixed
This commit is contained in:
parent
442cf3e937
commit
31a41b795e
@ -705,11 +705,27 @@ bool fs::dir::get_first(std::string& name, stat_t& info)
|
||||
WIN32_FIND_DATAW found;
|
||||
|
||||
m_dd = (intptr_t)FindFirstFileW(m_path.get(), &found);
|
||||
|
||||
if (m_dd == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
name = ConvertWCharToUTF8(found.cFileName);
|
||||
|
||||
info.is_directory = (found.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0;
|
||||
info.is_writable = (found.dwFileAttributes & FILE_ATTRIBUTE_READONLY) == 0;
|
||||
info.size = ((u64)found.nFileSizeHigh << 32) | (u64)found.nFileSizeLow;
|
||||
info.atime = to_time_t(found.ftLastAccessTime);
|
||||
info.mtime = to_time_t(found.ftLastWriteTime);
|
||||
info.ctime = to_time_t(found.ftCreationTime);
|
||||
|
||||
return true;
|
||||
#else
|
||||
m_dd = (intptr_t)::opendir(m_path.get());
|
||||
#endif
|
||||
|
||||
return get_next(name, info);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool fs::dir::get_next(std::string& name, stat_t& info)
|
||||
|
Loading…
Reference in New Issue
Block a user