read_bytes
fn read_bytes(string path) -> Result<Vec<byte>, IoError> Import
Source: use io::file::{read_bytes}; src/io/file.hy Reads the whole file at path.
Needs --allow-read.
Parameters#
| Name | Type |
|---|---|
path | string |
Returns#
Result<Vec<byte>, IoError>
Errors#
IoError::NotFound when the file does not exist, PermissionDenied when it cannot be opened.
See also#
write_bytes: Replaces the contents of the file atpathwithbuf, creating it if needed, and returns the number of bytes written.read_text: Reads the whole file atpathas UTF-8 text.write_text: Replaces the contents of the file atpathwithtext, creating it if needed, and returns the number of bytes written.append_bytes: Appendsbufto the file atpath, creating it if needed.append_text: Appendstextto the file atpath, creating it if needed.