import Std.IO
Types
File
type File =
c_file: C.File
File.open
File.open (path: String) (mode: String): File can Fs
File.close
File.close (file: File): Unit can Fs
File.eof
File.eof (f: ref File): Bool can Fs
Convenience function for using feof with better types
File.write
File.write (f: mut File) (text: String): Unit can Fs
File.next_char
File.next_char (f: ref File): Char can Fs
File.next_line
File.next_line (f: mut File): String can Fs
Functions
print_to_file
print_to_file (file: ref File) (f: a can Print, e): a can Fs, e
Handles Print by writing everything printed to file
read_line
read_line (): String can Fs
Read a line from stdin, ending with (and not including) a terminating ‘\n’
create_dir
create_dir (path: String): Unit can Fs, Fail
Create the directory at path.
Fails if it cannot be created, unless a directory already exists there.
create_dir_all
create_dir_all (path: String): Unit can Fs, Fail
Create each directory in path along with any missing parent directories.
Fails if any of them cannot be created.