⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

read_file

Function read_file 

Source
pub fn read_file(path: &str) -> Result<Vec<u8>, KernelError>
Expand description

Read the entire contents of a file into a Vec

This is a convenience function that opens a file, reads its entire contents into memory, and returns the data as a byte vector.

§Arguments

  • path - The filesystem path to the file

§Returns

  • Ok(Vec<u8>) - The file contents on success
  • Err(&'static str) - An error message on failure