Skip to content

GodotFileAccessFS

Namespace: Shadop.Archmage.Sdk

Implements the IFS interface to read files with Godot’s FileAccess. Paths can be res:// paths, user:// paths or operating system paths, and files in mounted resource packs can be read too.

public class GodotFileAccessFS : IFS

Inheritance Object → GodotFileAccessFS
Implements IFS

Remarks:

If you mount resource packs with ProjectSettings.LoadResourcePack, mount them before loading starts.

public bool MainThreadOnly { get; }

Boolean

public GodotFileAccessFS()
public Byte[] ReadAllBytes(string path)

path String

Byte[]

ReadAllBytesAsync(String, CancellationToken)

Section titled “ReadAllBytesAsync(String, CancellationToken)”
public Task<Byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken)

path String

cancellationToken CancellationToken

Task<Byte[]>

Remarks:

Godot has no asynchronous file read, so this method calls GodotFileAccessFS.ReadAllBytes(String) on a thread pool thread.

public bool FileExists(string path)

path String

Boolean

public bool DirectoryExists(string path)

path String

Boolean

Remarks:

Always returns true for res:// paths, because DirAccess does not report them reliably after the project is exported or a resource pack is mounted.