Skip to main content

Module io

Module io 

Source

Functionsยง

atomic_write
Atomically replace path with contents.
read_file_capped
Read at most max_bytes from path, rejecting files larger than the cap.
read_to_string_capped
UTF-8 decode a capped file read. Uses [MAX_FILE_BYTES] when max_bytes is not needed elsewhere.
replace_file
Replace path with tmp_path (tmp is consumed). Works on Windows where rename cannot overwrite an existing destination.