Skip to main content

nova_rt_fs_read_to_string

Function nova_rt_fs_read_to_string 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nova_rt_fs_read_to_string( path: *const NovaStr, ) -> i64
Expand description

Read path as UTF-8. Returns a status; on OK the contents are waiting in nova_rt_fs_take_string.

Non-UTF-8 contents are INVALID_DATA: std::fs::read_to_string reports ErrorKind::InvalidData for them, which is exactly the case that motivated adding that kind (see docs/adr/0011-io-error-kinds.md).

ยงSafety

path must point to a live NovaStr.