EllanJiang/GameFramework · error · GameFrameworkException

Create file system stream for

Error message

Create file system stream for '{0}' failure.

What it means

FileSystemManager.CreateFileSystem throws this when the registered IFileSystemHelper.CreateFileSystemStream returns null for the given path, access mode, and create=true. The helper is user-provided (e.g. DefaultFileSystemHelper); a null return means it could not open a stream for creating the file system file, so the manager aborts.

Solutions

  1. Register a file system helper before use: SetFileSystemHelper(new DefaultFileSystemHelper()) or SetFileSystemHelperType<DefaultFileSystemHelper>() on the FileSystemComponent.
  2. Inspect the custom IFileSystemHelper.CreateFileSystemStream implementation and make it return a valid FileSystemStream or throw a descriptive exception instead of returning null.
  3. Verify fullPath and FileSystemAccess arguments passed to CreateFileSystem are valid for the helper.

Example fix

// before
fileSystemManager.CreateFileSystem(fullPath, FileSystemAccess.ReadWrite, 1024, 256); // helper never set
// after
fileSystemManager.SetFileSystemHelper(new DefaultFileSystemHelper());
fileSystemManager.CreateFileSystem(fullPath, FileSystemAccess.ReadWrite, 1024, 256);
Defensive patterns

Strategy: validation

Validate before calling

// Ensure a helper is registered before any Create/Load call
if (!fileSystemHelperSet)
    fileSystemManager.SetFileSystemHelper(new DefaultFileSystemHelper());

Try / catch

try { fs = manager.CreateFileSystem(path, access, mc, mb); }
catch (GameFrameworkException ex) when (ex.Message.Contains("Create file system stream")) { Log.Error("FileSystemHelper missing or failed for " + path); }

Prevention

When it happens

Trigger: Calling CreateFileSystem when the bound FileSystemHelper's CreateFileSystemStream(fullPath, access, true) returns null - typically because the helper type is not registered (SetFileSystemHelper never called or called with a null/default instance) or the stream creation failed for the given access mode.

Common situations: Forgetting FileSystemComponent.SetFileSystemHelper / SetFileSystemHelperType before initialization; a custom IFileSystemHelper whose CreateFileSystemStream returns null on unsupported platforms or for invalid access values; file paths the helper cannot open.

Understand the failure class

Background: "not installed", "pip install", "required for": how missing-dependency errors surface across open-source libraries — this error's family across 34 libraries.

Related errors


AI-assisted analysis of EllanJiang/GameFramework@d0c010b051 (2026-09-15). Data as JSON: /api/errors/6b6a80912464b008. Report an issue: GitHub.

Appendix: source

Thrown at GameFramework/FileSystem/FileSystemManager.cs:168

            {
                throw new GameFrameworkException("Access is invalid.");
            }

            if (access == FileSystemAccess.Read)
            {
                throw new GameFrameworkException("Access read is invalid.");
            }

            fullPath = Utility.Path.GetRegularPath(fullPath);
            if (m_FileSystems.ContainsKey(fullPath))
            {
                throw new GameFrameworkException(Utility.Text.Format("File system '{0}' is already exist.", fullPath));
            }

            FileSystemStream fileSystemStream = m_FileSystemHelper.CreateFileSystemStream(fullPath, access, true);
            if (fileSystemStream == null)
            {
                throw new GameFrameworkException(Utility.Text.Format("Create file system stream for '{0}' failure.", fullPath));
            }

            FileSystem fileSystem = FileSystem.Create(fullPath, access, fileSystemStream, maxFileCount, maxBlockCount);
            if (fileSystem == null)
            {
                throw new GameFrameworkException(Utility.Text.Format("Create file system '{0}' failure.", fullPath));
            }

            m_FileSystems.Add(fullPath, fileSystem);
            return fileSystem;
        }

        /// <summary>
        /// 加载文件系统。
        /// </summary>
        /// <param name="fullPath">要加载的文件系统的完整路径。</param>
        /// <param name="access">要加载的文件系统的访问方式。</param>
        /// <returns>加载的文件系统。</returns>

View on GitHub (pinned to d0c010b051)