Provides a portable interface to the filesystem.
This module provides access to files in specific places:
resources/subdirectory in the same directory as the program executable,
resources.zipfile in the same directory as the program executable,
- The root folder of the game's "save" directory which is in a
~/.local/share/<gameid>/on Linux. The
gameidis the the string passed to
Context::load_from_conf(); some platforms such as Windows also incorporate the
authorstring into the path.
Files will be looked for in these locations in order, and the first one
found used. That allows game assets to be easily distributed as an archive
file, but locally overridden for testing or modding simply by putting
altered copies of them in the game's
Note that the file lookups WILL follow symlinks! It is more for convenience than absolute security, so don't treat it as being secure.
If you build
ggez with the
cargo-resource-root feature flag, it will
also look for a
resources/ subdirectory in the same directory as your
Cargo.toml, which can be very convenient for development.
A structure that contains the filesystem state and cache.
Represents a file, either in the filesystem, or in the resources zip file, or whatever.