patch_seq_file_slurp_safe

Function patch_seq_file_slurp_safe 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn patch_seq_file_slurp_safe( stack: Stack, ) -> Stack
Expand description

Read entire file contents as a string, with error handling

Stack effect: ( String โ€“ String Int )

Takes a file path, attempts to read the entire file. Returns (contents 1) on success, or (โ€œโ€ 0) on failure. Failure cases: file not found, permission denied, not valid UTF-8, etc.

ยงSafety

  • stack must be a valid, non-null stack pointer with a String value on top
  • Caller must ensure stack is not concurrently modified