mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-10 17:01:24 +12:00
More rFile cleanups and fixes.
Was using fileExists/dirExists before when really should have just been exists. File or Dir doesn't matter and would only create false negatives. Current working directory shouldn't really be used at all. This is just the folder the application is run from (not even where the .exe resides). Some of the infos required by vfsLocalDir such as executable may not be portable. Not sure of their intended function as they are never used.
This commit is contained in:
parent
6cb083be1a
commit
e8525a6f14
15 changed files with 180 additions and 132 deletions
|
@ -26,13 +26,18 @@ bool vfsLocalDir::Open(const std::string& path)
|
|||
std::string dir_path = path + name;
|
||||
|
||||
m_entries.emplace_back();
|
||||
// TODO: Use same info structure as fileinfo?
|
||||
DirEntryInfo& info = m_entries.back();
|
||||
info.name = name;
|
||||
|
||||
info.flags |= dir.Exists(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile;
|
||||
if(rIsWritable(dir_path)) info.flags |= DirEntry_PermWritable;
|
||||
if(rIsReadable(dir_path)) info.flags |= DirEntry_PermReadable;
|
||||
if(rIsExecutable(dir_path)) info.flags |= DirEntry_PermExecutable;
|
||||
FileInfo fileinfo;
|
||||
getFileInfo(dir_path.c_str(), &fileinfo);
|
||||
|
||||
// Not sure of purpose for below. I hope these don't need to be correct
|
||||
info.flags |= rIsDir(dir_path) ? DirEntry_TypeDir : DirEntry_TypeFile;
|
||||
if(fileinfo.isWritable) info.flags |= DirEntry_PermWritable;
|
||||
info.flags |= DirEntry_PermReadable; // Always?
|
||||
info.flags |= DirEntry_PermExecutable; // Always?
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue