Function nstd_sys::fs::nstd_fs_write
source · #[no_mangle]
pub unsafe extern "C" fn nstd_fs_write(
path: &NSTDStr,
content: &NSTDSlice
) -> NSTDIOErrorAvailable on crate feature
nstd_fs only.Expand description
Overwrites the contents of a file.
Parameters:
-
const NSTDStr *path- A path to the file to write to. -
const NSTDSlice *content- The new content to write to the file.
Returns
NSTDIOError errc - The I/O operation error code.
Panics
This operation will panic in the following situations:
-
path’s length in bytes is greater thanNSTDInt’s max value. -
content’s stride is not 1. -
content’s length is greater thanNSTDInt’s max value.
Safety
This operation can cause undefined behavior if either path or content’s data is invalid.