Table of Contents

Class EditorFileSystem

Resource filesystem, as the editor sees it.

Inheritance
EditorFileSystem

Remarks

This object holds information of all resources in the filesystem, their types, etc.

Note: This class shouldn't be instantiated directly. Instead, access the singleton using get_resource_filesystem.

Methods

get_file_type(String)

Qualifiers: const

Returns the resource type of the file, given the full path. This returns a string such as "Resource" or "GDScript", not a file extension such as ".gd".

String get_file_type(String path)

Parameters

path String

get_filesystem

Gets the root directory object.

EditorFileSystemDirectory get_filesystem

get_filesystem_path(String)

Returns a view into the filesystem at path.

EditorFileSystemDirectory get_filesystem_path(String path)

Parameters

path String

get_scanning_progress

Qualifiers: const

Returns the scan progress for 0 to 1 if the FS is being scanned.

float get_scanning_progress

is_scanning

Qualifiers: const

Returns true if the filesystem is being scanned.

bool is_scanning

reimport_files(PackedStringArray)

Reimports a set of files. Call this if these files or their .import files were directly edited by script or an external program.

If the file type changed or the file was newly created, use EditorFileSystem.update_file or scan.

Note: This function blocks until the import is finished. However, the main loop iteration, including timers and Node._process, will occur during the import process due to progress bar updates. Avoid calls to EditorFileSystem.reimport_files or scan while an import is in progress.

void reimport_files(PackedStringArray files)

Parameters

files PackedStringArray

scan

Scan the filesystem for changes.

void scan

scan_sources

Check if the source of any imported resource changed.

void scan_sources

update_file(String)

Add a file in an existing directory, or schedule file information to be updated on editor restart. Can be used to update text files saved by an external program.

This will not import the file. To reimport, call EditorFileSystem.reimport_files or scan methods.

void update_file(String path)

Parameters

path String

Events

filesystem_changed

Emitted if the filesystem changed.

signal filesystem_changed

resources_reimported(PackedStringArray)

Emitted if a resource is reimported.

signal resources_reimported(PackedStringArray resources)

Parameters

resources PackedStringArray

resources_reimporting(PackedStringArray)

Emitted before a resource is reimported.

signal resources_reimporting(PackedStringArray resources)

Parameters

resources PackedStringArray

resources_reload(PackedStringArray)

Emitted if at least one resource is reloaded when the filesystem is scanned.

signal resources_reload(PackedStringArray resources)

Parameters

resources PackedStringArray

script_classes_updated

Emitted when the list of global script classes gets updated.

signal script_classes_updated

sources_changed(bool)

Emitted if the source of any imported file changed.

signal sources_changed(bool exist)

Parameters

exist bool