io

stdlib::rss::io

High-level text file operations built on the native io namespace.

Import

use stdlib::rss::io;

Functions

FunctionDescription
read_textReads an entire file into a string.
write_textWrites text to a file, replacing any existing contents.
append_textAppends text to the end of a file.
read_linesReads a file and splits it into newline-delimited lines.

Function details

read_text

pub fn read_text(path: string) -> string

Reads an entire file into a string.

write_text

pub fn write_text(path: string, text: string) -> int

Writes text to a file, replacing any existing contents.

append_text

pub fn append_text(path: string, text: string) -> int

Appends text to the end of a file.

read_lines

pub fn read_lines(path: string) -> [string]

Reads a file and splits it into newline-delimited lines.