public Result CreateSaveDataMetaFile(ulong saveDataId, SaveDataSpaceId spaceId, SaveMetaType type, long size) { string metaDirPath = $"/saveMeta/{saveDataId:x16}"; Result rc = OpenSaveDataDirectoryImpl(out IFileSystem tmpMetaDirFs, spaceId, metaDirPath, true); using IFileSystem metaDirFs = tmpMetaDirFs; if (rc.IsFailure()) { return(rc); } string metaFilePath = $"/{(int)type:x8}.meta"; if (size < 0) { return(ResultFs.ValueOutOfRange.Log()); } return(metaDirFs.CreateFile(metaFilePath, size, CreateFileOptions.None)); }
public Result OpenSaveDataMetaFile(out IFile file, ulong saveDataId, SaveDataSpaceId spaceId, SaveMetaType type) { file = default; string metaDirPath = $"/saveMeta/{saveDataId:x16}"; Result rc = OpenSaveDataDirectoryImpl(out IFileSystem tmpMetaDirFs, spaceId, metaDirPath, true); using IFileSystem metaDirFs = tmpMetaDirFs; if (rc.IsFailure()) { return(rc); } string metaFilePath = $"/{(int)type:x8}.meta"; return(metaDirFs.OpenFile(out file, metaFilePath, OpenMode.ReadWrite)); }