mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-12-23 08:50:57 +01:00
common: fs: file: Flush the file in GetSize
This ensures that GetSize always retrieves the correct file size after a write operation.
This commit is contained in:
parent
bf50345d4c
commit
d299d5531f
1 changed files with 3 additions and 0 deletions
|
@ -347,6 +347,9 @@ u64 IOFile::GetSize() const {
|
|||
return 0;
|
||||
}
|
||||
|
||||
// Flush any unwritten buffered data into the file prior to retrieving the file size.
|
||||
std::fflush(file);
|
||||
|
||||
std::error_code ec;
|
||||
|
||||
const auto file_size = fs::file_size(file_path, ec);
|
||||
|
|
Loading…
Reference in a new issue