file

type dir < sequence

TBD

fun dir(Path: string): dir

TBD

meth (Dir: dir):read: string

TBD

type file < stream

A file handle for reading / writing.

fun file(Path: string, Mode: string): file

Opens the file at Path depending on Mode,

  • "r": opens the file for reading,

  • "w": opens the file for writing,

  • "a": opens the file for appending.

meth (File: file):close

Closes File.

meth (File: file):eof: File | nil

Returns File if File is closed, otherwise return nil.

meth (File: file):flush

Flushes any pending writes to File.

type file::mode < enum
  • ::DIR

  • ::CHR

  • ::BLK

  • ::REG

  • ::LNK

  • ::SOCK

  • ::FIFO

type file::stat

TBD

fun file::stat(Path: string): file::stat

TBD

meth (Arg₁: file::stat):atime

TBD

meth (Arg₁: file::stat):ctime

TBD

meth (Arg₁: file::stat):mode

TBD

meth (Arg₁: file::stat):mtime

TBD

meth (Arg₁: file::stat):size

TBD

type popen < file

A file that reads or writes to a running subprocess.

fun popen(Command: string, Mode: string): popen

Executes Command with the shell and returns an open file to communicate with the subprocess depending on Mode,

  • "r": opens the file for reading,

  • "w": opens the file for writing.

meth (File: popen):close: integer

Waits for the subprocess to finish and returns the exit status.

fun dir::create(Path: string, Mode: integer)

TBD

fun dir::remove(Path: string)

TBD

fun file::exists(Path: string): string | nil

TBD

fun file::rename(Old: string, New: string)

Renames the file Old to New.

fun file::unlink(Path: string)

Removes the file at Path.