std/fs
The file system: File, which is both a stream's reading end and its writing end, and IoError, what every
operation here fails with. The whole-file helpers (readText, writeText, readBytes, writeBytes) are for what
fits in memory; chunks(), lines() and the Sink side are for everything else (docs/design/STREAMS.md).
Around the contents: remove, rename, copy, createDirectory, removeDirectory, list and walk for the tree,
metadata for what a path is, symbolic links, temporary files and directories, and writeBytesAtomically for a
file that is replaced whole or not at all. Every one of them takes the same path text on every system - / between
the names, a drive letter on Windows - and the runtime converts it where it calls the system (docs/design/PATH.md
section 6), so nothing here branches on the operating system.
Modules
std/fs/libThe file system:File, which is both a stream's reading end and its writing end, andIoError, what every operation here fails with.std/fs/metadataWhatFile.metadataanswers about a path: [Metadata], with its [FileKind] and its [Permissions].
Everything
- type
FileA file that is open. - type
FileKindWhat a path names. - type
IoErrorWhat went wrong with which path. - extend
IoError with From<Utf8Error>Bytes off a disk are not always UTF-8, and aStringalways is - so decoding is one of the ways reading fails. - type
MetadataWhat a path is, how large, when it was last written, and who may do what with it. - type
PermissionsThe permission bits of a file, the way POSIX writes them: read, write and execute for the owner, the group and everybody else -0b111_101_101, which is0o755- plus the set-id and sticky bits above them.