write

Function write 

Source
pub fn write<P: AsRef<Path>, C: AsRef<[u8]>>(
    path: P,
    contents: C,
) -> Result<(), ApiError>
Expand description

Write a bytes of the entire contents of a file.

This function will create a file if it does not exist, and will entirely replace its contents if it does.

Works similarly to [std::fs::write].

Uses sys::ffi::playdate_file::open and sys::ffi::playdate_file::write.