Expand description
Filesystem manipulation operations.
This module contains basic methods to manipulate the contents of the brain’s micro SDCard. All methods in this module represent VEXos filesystem operations.
§VEXos Limitations
While this module largely mimicks Rust’s std::fs
API, there are several major
limitations in the VEXos filesystem. This module only provides a small subset of
what would normally be expected in a typical Rust enviornment. Notably:
- Files cannot be opened as read and write at the same time (only one). To read a file that you’ve written to, you’ll need to drop your written file descriptor and reopen it as readonly.
- Files can be created, but not deleted or renamed.
- Directories cannot be created or enumerated from the Brain, only top-level files.
Structs§
- DirEntry
- An entry returned by the
ReadDir
iterator. - Display
- A type that allows safely displaying
FsStr
s that may contain non-UTF-8 data. - File
- Represents a file in the file system.
- File
Type - A structure representing a type of file with accessors for each file type.
It is returned by
Metadata::file_type
method. - FsStr
- Borrowed reference to an VEXos filesystem OS string.
- FsString
- A type that represents a mutable and owned VEXos filesystem string, while being cheaply inter-convertible with Rust strings.
- Metadata
- Metadata information about a file.
- Open
Options - Options and flags which can be used to configure how a file is opened.
- ReadDir
- An iterator over the entries of a directory.
Functions§
- copy
- Copies the contents of one file to another.
- exists
- Returns true if the path points to a file that exists on the filesystem.
- metadata
- Gets the metadata for a file or path.
- read
- Reads the entire contents of a file into a vector.
- read_
dir - Returns an iterator over the items in a directory.
- read_
to_ string - Reads the entire contents of a file into a string.
- write
- Writes an entire buffer to a file, replacing its contents.