mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-07 11:31:39 +12:00
[FS] Implement GetFileSize [PTM] Stub step functions
This commit is contained in:
parent
49dcc25795
commit
e052c16a36
5 changed files with 76 additions and 7 deletions
|
@ -75,17 +75,17 @@ public:
|
|||
return write(data, count, sizeof(std::uint8_t));
|
||||
}
|
||||
|
||||
std::uint64_t size() {
|
||||
if (!isOpen()) return 0;
|
||||
std::optional<std::uint64_t> size() {
|
||||
if (!isOpen()) return {};
|
||||
|
||||
std::uint64_t pos = ftello(handle);
|
||||
if (fseeko(handle, 0, SEEK_END) != 0) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
std::uint64_t size = ftello(handle);
|
||||
if ((size != pos) && (fseeko(handle, pos, SEEK_SET) != 0)) {
|
||||
return 0;
|
||||
return {};
|
||||
}
|
||||
|
||||
return size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue