write_bytes
fn write_bytes(string path, Vec<byte> buf) -> Result<int, IoError> Import
Source: use io::file::{write_bytes}; src/io/file.hy Replaces the contents of the file at path with buf, creating it if needed, and returns the number of bytes written. Needs --allow-write.
Parameters#
| Name | Type |
|---|---|
path | string |
buf | Vec<byte> |
Returns#
Result<int, IoError>
See also#
read_bytes: Reads the whole file atpath.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.