mirror of
https://github.com/Thealexbarney/LibHac.git
synced 2024-11-14 10:49:41 +01:00
Open temp directory savedata properly
This commit is contained in:
parent
9c402df18a
commit
5c1a7920d2
2 changed files with 5 additions and 6 deletions
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue