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 : IFSInheritance Object → GodotFileAccessFS
Implements IFS
Remarks:
If you mount resource packs with ProjectSettings.LoadResourcePack, mount them before loading starts.
Properties
Section titled “Properties”MainThreadOnly
Section titled “MainThreadOnly”public bool MainThreadOnly { get; }Property Value
Section titled “Property Value”Constructors
Section titled “Constructors”GodotFileAccessFS()
Section titled “GodotFileAccessFS()”public GodotFileAccessFS()Methods
Section titled “Methods”ReadAllBytes(String)
Section titled “ReadAllBytes(String)”public Byte[] ReadAllBytes(string path)Parameters
Section titled “Parameters”path String
Returns
Section titled “Returns”ReadAllBytesAsync(String, CancellationToken)
Section titled “ReadAllBytesAsync(String, CancellationToken)”public Task<Byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken)Parameters
Section titled “Parameters”path String
cancellationToken CancellationToken
Returns
Section titled “Returns”Remarks:
Godot has no asynchronous file read, so this method calls GodotFileAccessFS.ReadAllBytes(String) on a thread pool thread.
FileExists(String)
Section titled “FileExists(String)”public bool FileExists(string path)Parameters
Section titled “Parameters”path String
Returns
Section titled “Returns”DirectoryExists(String)
Section titled “DirectoryExists(String)”public bool DirectoryExists(string path)Parameters
Section titled “Parameters”path String
Returns
Section titled “Returns”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.