Skip to content
Search

Godot:FileSystem

lastmod 2020-11-29created 2020-11-292 edits

A file system manages how assets are stored and how they are accessed. A well-designed file system also allows multiple developers to collaborate while editing the same source files and assets. Godot stores all assets as files in its file system.

Resource path

When accessing resources, using the host OS file system layout can be cumbersome and non-portable. To solve this problem, the special path res:// was created.

The path res:// will always point at the project root (where project.godot is located, so res://project.godot is always valid).

The file system is read-write only when running the project locally from the editor. When exported or when running on different devices (such as phones or consoles, or running from DVD), the file system becomes read-only and writing is no longer permitted.

User path

Writing to disk is still needed for tasks such as saving game state or downloading content packs. For this, the engine ensures that there is a special path user:// that is always writable. This path resolves differently depending on the OS the project is running on. Local path resolution is explained in detail in Data paths.

Host file system

Alternatively, host file system paths can also be used, but this is not recommended for a released product, as these paths are not guaranteed to work on all platforms. However, host file system paths can be useful when writing development tools in Godot.

See also

Favorite site

author Zer0 sitemap