Skip to main content

load_file_buf

Function load_file_buf 

Source
pub fn load_file_buf(name: &str) -> Option<FileBuf>
Expand description

Read the whole file with the given name.

If you have a pre-allocated buffer of the right size, use load_file instead.

None is returned if the file does not exist.

Examples found in repository?
examples/image/main.rs (line 18)
17extern "C" fn boot() {
18    let file = ff::load_file_buf("img").unwrap();
19    unsafe {
20        IMAGE.set(file).ok().unwrap();
21    }
22}