Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }