Struct ggez::filesystem::Filesystem[][src]

pub struct Filesystem { /* fields omitted */ }

A structure that contains the filesystem state and cache.

Methods

impl Filesystem
[src]

Create a new Filesystem instance, using the given id and (on some platforms) the author as a portion of the user directory path. This function is called automatically by ggez, the end user should never need to call it.

Opens the given path and returns the resulting File in read-only mode.

Opens a file in the user directory with the given filesystem::OpenOptions. Note that even if you open a file read-only, it can only access files in the user directory.

Creates a new file in the user directory and opens it to be written to, truncating it if it already exists.

Create an empty directory in the user dir with the given name. Any parents to that directory that do not exist will be created.

Deletes the specified file in the user dir.

Deletes the specified directory in the user dir, and all its contents!

Check whether a file or directory exists.

Check whether a path points at a file.

Check whether a path points at a directory.

Return the full path to the user data directory

Return the full path to the user config directory

Returns the full path to the resource directory (even if it doesn't exist)

Returns a list of all files and directories in the resource directory, in no particular order.

Lists the base directory if an empty path is given.

Prints the contents of all data directories. Useful for debugging.

Outputs the contents of all data directories, using the "info" log level of the log crate. Useful for debugging.

See the logging example for how to collect log information.

Adds the given (absolute) path to the list of directories it will search to look for resources.

You probably shouldn't use this in the general case, since it is harder than it looks to make it bulletproof across platforms. But it can be very nice for debugging and dev purposes, such as by pushing $CARGO_MANIFEST_DIR/resources to it

Looks for a file named "/conf.toml" in any resource directory and loads it if it finds it. If it can't read it for some reason, returns an error.

Takes a conf::Conf object and saves it to the user directory, overwriting any file already there.

Trait Implementations

impl Debug for Filesystem
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl !Send for Filesystem

impl !Sync for Filesystem