Std.Io
47 public declarations
- append
Str -> Str -> Result[(), Str]Contents added to the end of a file, creating it when it is absent.
- appendAllBytes
Str -> &Bytes -> Result[(), Std.Io.IoError]Add bytes after what a file already holds.
- appendLine
Str -> Str -> Result[(), Str]A line added to the end of a file.
- classified
Str -> Str -> Std.Io.IoErrorThe cause an operating-system message names for a path, so other modules
- copy
Str -> Str -> Result[(), Str]A file copied byte for byte, or a report of what stopped it.
- countBytes
Str -> Result[Int, Std.Io.IoError]How many bytes a file holds, without holding any of them.
- directoryOf
Str -> StrA path without its last piece, or `.` when it has only one.
- exists
Str -> BoolWhether a path names something that exists.
- extensionOf
Str -> Option[Str]A path's extension, without its dot, or nothing when it has none.
- foldChunks
&Std.Io.Reader -> T -> fn(T, Bytes) -> T -> Result[T, Std.Io.IoError]Combine every chunk of a file into one value, holding one chunk at a time.
- foldLines
Str -> T -> fn(T, Str) -> T -> Result[T, Std.Io.IoError]Combine every line of a file into one value, holding one chunk at a time.
- forEachChunk
&Std.Io.Reader -> fn(Bytes) -> () -> Result[(), Std.Io.IoError]Run an action for every chunk, keeping nothing.
- forEachLine
Str -> fn(Str) -> () -> Result[(), Std.Io.IoError]Run an action for every line of a file, keeping nothing.
- IoError
Why an operation over a file did not do what it was asked.
- isSeparator
Str -> BoolWhether a character ends a piece of a path on this machine.
- join
Str -> Str -> StrTwo path pieces joined with a separator, without doubling one.
- list
Str -> Result[Array[Str], Str]The names a directory holds, without their paths.
- listPaths
Str -> Result[Array[Str], Str]The paths a directory holds, each joined to the directory.
- makeDirectory
Str -> Result[(), Str]A directory created along with every parent it needs.
- move
Str -> Str -> Result[(), Str]A file moved by renaming it, copying only when a rename cannot reach.
- nameOf
Str -> StrThe last piece of a path.
- read
Str -> Result[Str, Str]A file's whole contents.
- readAllBytes
Str -> Result[Bytes, Std.Io.IoError]Every byte of a file, joined once rather than once per chunk.
- readAllLines
Result[Array[Str], Str]Every remaining line of input.
- readAllLinesOf
Str -> Result[Array[Str], Std.Io.IoError]Every line of a file, in order.
- Reader
A file open for reading, named by a token the runtime gave out.
- readFrom
&Std.Io.Reader -> Int -> Result[Option[Bytes], Std.Io.IoError]The next bytes from a reader, or nothing when the input has ended.
- readLineOrEnd
Result[Option[Str], Str]One line of input, or `None` at the end of it.
- readLines
Str -> Result[Array[Str], Str]A file's contents in lines.
- remove
Str -> Result[(), Str]A file removed, or a report of why it could not be.
- removeIfPresent
Str -> Result[(), Str]A file removed if it is there, and nothing done if it is not.
- separator
StrThe path vocabulary, so a program reaching for it through `Std.Io` finds
- withAppender
Str -> fn(Std.Io.Writer) -> Result[T, Std.Io.IoError] -> Result[T, Std.Io.IoError]Write after what the file already holds.
- withExtension
Str -> Str -> StrA path carrying the given extension, replacing any it had.
- withoutExtension
Str -> StrA path with its extension removed.
- withReader
Str -> fn(Std.Io.Reader) -> Result[T, Std.Io.IoError] -> Result[T, Std.Io.IoError]Read a file through a handle the runtime owns for the length of the call.
- withWriter
Str -> fn(Std.Io.Writer) -> Result[T, Std.Io.IoError] -> Result[T, Std.Io.IoError]Write a file the same way, replacing whatever it held.
- write
Str -> Str -> Result[(), Str]A file replaced with the given contents.
- writeAllBytes
Str -> &Bytes -> Result[(), Std.Io.IoError]Write bytes to a file, replacing what it held.
- writeErrorLine
Str -> Result[(), Str]A line written to the program's error output.
- writeFileLines
Str -> &Array[Str] -> Result[(), Str]Lines written to a file, each followed by a newline.
- writeLine
Str -> Result[(), Str]A line written to the program's output.
- writeLines
&Array[Str] -> Result[(), Str]Every line written in order, stopping at the first that fails.
- Writer
A file open for writing.
- writeTextTo
&Std.Io.Writer -> Str -> Result[(), Std.Io.IoError]Write text through a writer, as its UTF-8 encoding.
- writeTo
&Std.Io.Writer -> &Bytes -> Result[(), Std.Io.IoError]Write bytes through a writer.
- writeValue
T -> Result[(), Str]Any value rendered and written as a line.
