diff --git a/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs b/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs index 958a85a9..68db8482 100644 --- a/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs +++ b/src/LibHac/FsService/Creators/SaveDataFileSystemCreator.cs @@ -42,8 +42,10 @@ namespace LibHac.FsService.Creators // if (!allowDirectorySaveData) return ResultFs.InvalidSaveDataEntryType.Log(); var subDirFs = new SubdirectoryFileSystem(sourceFileSystem, saveDataPath); + bool isPersistentSaveData = type != SaveDataType.Temporary; + bool isUserSaveData = type == SaveDataType.Account || type == SaveDataType.Device; - rc = DirectorySaveDataFileSystem.CreateNew(out DirectorySaveDataFileSystem saveFs, subDirFs); + rc = DirectorySaveDataFileSystem.CreateNew(out DirectorySaveDataFileSystem saveFs, subDirFs, isPersistentSaveData, isUserSaveData); if (rc.IsFailure()) return rc; fileSystem = saveFs; diff --git a/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs b/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs index 38f9fad7..a1bea99c 100644 --- a/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs +++ b/src/LibHac/FsSystem/DirectorySaveDataFileSystem.cs @@ -16,11 +16,6 @@ namespace LibHac.FsSystem // ReSharper disable once UnusedAutoPropertyAccessor.Local private bool IsUserSaveData { get; set; } - public static Result CreateNew(out DirectorySaveDataFileSystem created, IFileSystem baseFileSystem) - { - return CreateNew(out created, baseFileSystem, true, true); - } - public static Result CreateNew(out DirectorySaveDataFileSystem created, IFileSystem baseFileSystem, bool isPersistentSaveData, bool isUserSaveData) { @@ -215,6 +210,8 @@ namespace LibHac.FsSystem { lock (Locker) { + if(!IsPersistentSaveData) return Result.Success; + if (OpenWritableFileCount > 0) { // All files must be closed before commiting save data.