logo
This is supported on crate feature fs_utf8 only.
Expand description

A fully UTF-8 filesystem API modeled after cap_std::fs.

Where cap_std::fs would use Path and PathBuf, this fs_utf8 module uses Utf8Path and Utf8PathBuf, meaning that all paths are valid UTF-8.

But wait, POSIX doesn’t require filenames to be UTF-8! What happens if there’s a file with a non-UTF-8 name? To address this, this module uses ARF strings to encode non-UTF-8-encodable filenames as UTF-8. See the link for details, but the big picture is that all possible byte sequences are losslessly representable. The easy case of a file with a valid UTF-8 name is easy, and the tricky case of a valid with an invalid UTF-8 name is possible – it may take more work to handle properly, especially if you want to do interesting path manipulation, but it is possible.

TODO: This whole scheme is still under development.

To use this module, enable the fs_utf8 cargo feature.

If you don’t want to restrict paths to UTF-8, use the regular cap_std::fs module instead.

Structs

A reference to an open directory on a filesystem.

A builder used to create directories in various manners.

Entries returned by the ReadDir iterator.

A reference to an open file on a filesystem.

A structure representing a type of file with accessors for each file type.

Metadata information about a file.

Options and flags which can be used to configure how a file is opened.

Representation of the various permissions on a file.

Iterator over the entries in a directory.