Function in io::file coil-stdlib

write_bytes

fn write_bytes(string path, Vec<byte> buf) -> Result<int, IoError>
Import
use io::file::{write_bytes};
Source: 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#

NameType
pathstring
bufVec<byte>

Returns#

Result<int, IoError>

See also#

  • read_bytes: Reads the whole file at path.
  • read_text: Reads the whole file at path as UTF-8 text.
  • write_text: Replaces the contents of the file at path with text, creating it if needed, and returns the number of bytes written.
  • append_bytes: Appends buf to the file at path, creating it if needed.
  • append_text: Appends text to the file at path, creating it if needed.
↑ ↓ navigate ↵ open