always set FsCreateOption_BigFile in fs.cpp when creating 4GiB+ file.

This commit is contained in:
ITotalJustice
2025-06-25 19:28:23 +01:00
parent 9b967a9af0
commit 0bfd336796
2 changed files with 5 additions and 3 deletions

View File

@@ -99,7 +99,6 @@ private:
};
Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, BaseSource* source, std::span<const fs::FsPath> paths) {
constexpr s64 BIG_FILE_SIZE = 1024ULL*1024ULL*1024ULL*4ULL;
const auto is_file_based_emummc = App::IsFileBaseEmummc();
for (const auto& path : paths) {
@@ -113,8 +112,7 @@ Result DumpToFile(ui::ProgressBox* pbox, fs::Fs* fs, const fs::FsPath& root, Bas
fs->CreateDirectoryRecursivelyWithPath(temp_path);
fs->DeleteFile(temp_path);
const auto flags = file_size >= BIG_FILE_SIZE ? FsCreateOption_BigFile : 0;
R_TRY(fs->CreateFile(temp_path, file_size, flags));
R_TRY(fs->CreateFile(temp_path, file_size));
ON_SCOPE_EXIT(fs->DeleteFile(temp_path));
{

View File

@@ -112,6 +112,10 @@ FsPath AppendPath(const FsPath& root_path, const FsPath& _file_path) {
Result CreateFile(FsFileSystem* fs, const FsPath& path, u64 size, u32 option, bool ignore_read_only) {
R_UNLESS(ignore_read_only || !is_read_only_root(path), Result_FsReadOnly);
if (size >= 1024ULL*1024ULL*1024ULL*4ULL) {
option |= FsCreateOption_BigFile;
}
R_TRY(fsFsCreateFile(fs, path, size, option));
fsFsCommit(fs);
R_SUCCEED();