mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-26 19:32:40 -06:00
vfs_real: ensure size cache is reset on write
This commit is contained in:
parent
bf47f777b1
commit
94e7cb05da
1 changed files with 2 additions and 0 deletions
|
@ -270,6 +270,7 @@ std::size_t RealVfsFile::GetSize() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool RealVfsFile::Resize(std::size_t new_size) {
|
bool RealVfsFile::Resize(std::size_t new_size) {
|
||||||
|
size.reset();
|
||||||
base.RefreshReference(path, perms, *reference);
|
base.RefreshReference(path, perms, *reference);
|
||||||
return reference->file ? reference->file->SetSize(new_size) : false;
|
return reference->file ? reference->file->SetSize(new_size) : false;
|
||||||
}
|
}
|
||||||
|
@ -295,6 +296,7 @@ std::size_t RealVfsFile::Read(u8* data, std::size_t length, std::size_t offset)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t RealVfsFile::Write(const u8* data, std::size_t length, std::size_t offset) {
|
std::size_t RealVfsFile::Write(const u8* data, std::size_t length, std::size_t offset) {
|
||||||
|
size.reset();
|
||||||
base.RefreshReference(path, perms, *reference);
|
base.RefreshReference(path, perms, *reference);
|
||||||
if (!reference->file || !reference->file->Seek(static_cast<s64>(offset))) {
|
if (!reference->file || !reference->file->Seek(static_cast<s64>(offset))) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue