[SaveData] Implement OpenDirectory with filename
This commit is contained in:
@@ -132,7 +132,8 @@ enum class FSResult : u32 {
|
|||||||
Success = 0,
|
Success = 0,
|
||||||
AlreadyExists = 0x82044BE,
|
AlreadyExists = 0x82044BE,
|
||||||
FileTooLarge = 0x86044D2,
|
FileTooLarge = 0x86044D2,
|
||||||
FileNotFound = 0xC8804470
|
FileNotFound = 0xC8804470,
|
||||||
|
UnexpectedFileOrDir = 0xE0C04702
|
||||||
};
|
};
|
||||||
|
|
||||||
class ArchiveBase {
|
class ArchiveBase {
|
||||||
|
|||||||
@@ -66,8 +66,10 @@ Rust::Result<DirectorySession, FSResult> SaveDataArchive::openDirectory(const FS
|
|||||||
fs::path p = IOFile::getAppData() / "SaveData";
|
fs::path p = IOFile::getAppData() / "SaveData";
|
||||||
p += fs::path(path.utf16_string).make_preferred();
|
p += fs::path(path.utf16_string).make_preferred();
|
||||||
|
|
||||||
if (fs::is_regular_file(p))
|
if (fs::is_regular_file(p)) {
|
||||||
Helpers::panic("OpenDirectory: Tried to open directory but it's actually a file");
|
printf("SaveData: OpenArchive used with a file path");
|
||||||
|
return Err(FSResult::UnexpectedFileOrDir);
|
||||||
|
}
|
||||||
|
|
||||||
if (fs::is_directory(p)) {
|
if (fs::is_directory(p)) {
|
||||||
return Ok(DirectorySession(this, p));
|
return Ok(DirectorySession(this, p));
|
||||||
|
|||||||
Reference in New Issue
Block a user