mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-25 00:04:49 +02:00
Io: Cleanup access bits for files.
Also, we default a lot of these members, so don't need to reset.
This commit is contained in:
@@ -571,6 +571,7 @@ PSPFileInfo VirtualDiscFileSystem::GetFileInfo(std::string filename) {
|
||||
fileInfo.exists = true;
|
||||
fileInfo.type = FILETYPE_NORMAL;
|
||||
fileInfo.size = readSize;
|
||||
fileInfo.access = 0444;
|
||||
fileInfo.startSector = sectorStart;
|
||||
fileInfo.isOnSectorSystem = true;
|
||||
fileInfo.numSectors = (readSize + 2047) / 2048;
|
||||
@@ -582,6 +583,7 @@ PSPFileInfo VirtualDiscFileSystem::GetFileInfo(std::string filename) {
|
||||
x.type = FILETYPE_NORMAL;
|
||||
x.isOnSectorSystem = true;
|
||||
x.startSector = fileList[fileIndex].firstBlock;
|
||||
x.access = 0555;
|
||||
|
||||
HandlerFileHandle temp = fileList[fileIndex].handler;
|
||||
if (temp.Open(basePath, filename, FILEACCESS_READ)) {
|
||||
@@ -610,6 +612,7 @@ PSPFileInfo VirtualDiscFileSystem::GetFileInfo(std::string filename) {
|
||||
|
||||
x.type = File::IsDirectory(fullName) ? FILETYPE_DIRECTORY : FILETYPE_NORMAL;
|
||||
x.exists = true;
|
||||
x.access = 0555;
|
||||
if (fileIndex != -1) {
|
||||
x.isOnSectorSystem = true;
|
||||
x.startSector = fileList[fileIndex].firstBlock;
|
||||
@@ -621,12 +624,8 @@ PSPFileInfo VirtualDiscFileSystem::GetFileInfo(std::string filename) {
|
||||
ERROR_LOG(FILESYS, "DirectoryFileSystem::GetFileInfo: GetFileDetails failed: %s", fullName.c_str());
|
||||
x.size = 0;
|
||||
x.access = 0;
|
||||
memset(&x.atime, 0, sizeof(x.atime));
|
||||
memset(&x.ctime, 0, sizeof(x.ctime));
|
||||
memset(&x.mtime, 0, sizeof(x.mtime));
|
||||
} else {
|
||||
x.size = details.size;
|
||||
x.access = details.access;
|
||||
time_t atime = details.atime;
|
||||
time_t ctime = details.ctime;
|
||||
time_t mtime = details.mtime;
|
||||
@@ -691,7 +690,7 @@ std::vector<PSPFileInfo> VirtualDiscFileSystem::GetDirListing(std::string path)
|
||||
entry.type = FILETYPE_NORMAL;
|
||||
}
|
||||
|
||||
entry.access = FILEACCESS_READ;
|
||||
entry.access = 0555;
|
||||
entry.size = findData.nFileSizeLow | ((u64)findData.nFileSizeHigh<<32);
|
||||
entry.name = ConvertWStringToUTF8(findData.cFileName);
|
||||
tmFromFiletime(entry.atime, findData.ftLastAccessTime);
|
||||
@@ -737,7 +736,7 @@ std::vector<PSPFileInfo> VirtualDiscFileSystem::GetDirListing(std::string path)
|
||||
entry.type = FILETYPE_DIRECTORY;
|
||||
else
|
||||
entry.type = FILETYPE_NORMAL;
|
||||
entry.access = s.st_mode & 0x1FF;
|
||||
entry.access = 0555;
|
||||
entry.name = dirp->d_name;
|
||||
entry.size = s.st_size;
|
||||
localtime_r((time_t*)&s.st_atime,&entry.atime);
|
||||
|
||||
Reference in New Issue
Block a user