mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 23:25:40 +12:00
[SaveData] Implement OpenDirectory with filename
This commit is contained in:
parent
3abc60457d
commit
876835852d
2 changed files with 6 additions and 3 deletions
|
@ -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));
|
||||||
|
|
Loading…
Add table
Reference in a new issue