File

Simple file reading utilities

It

The file objects

self {
  FILE* handle
  I64 size
}

open

Open a file for reading

File open(String filePath)

Parameters

  • filePath — Path to the file

Returns — The file


close

Close an open file

U0 close(File file)

Parameters

  • file — The file

read

Read the entire file contents into a String

String read(File file)

Parameters

  • file — The file

Returns — File contents, or empty string on error