Std.IO

import Std.IO

Source


Types


File

type File =
    c_file: C.File

source


File.open

File.open (path: String) (mode: String): File can Fs

source


File.close

File.close (file: File): Unit can Fs

source


File.eof

File.eof (f: ref File): Bool can Fs

Convenience function for using feof with better types

source


File.write

File.write (f: mut File) (text: String): Unit can Fs

source


File.next_char

File.next_char (f: ref File): Char can Fs

source


File.next_line

File.next_line (f: mut File): String can Fs

source


Functions


print_to_file (file: ref File) (f: a can Print, e): a can Fs, e

Handles Print by writing everything printed to file

source


read_line

read_line (): String can Fs

Read a line from stdin, ending with (and not including) a terminating ‘\n’

source


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.

source


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.

source


Implicits


Show Implicits

drop_file

impl drop_file: Drop File Fs

source


iterator_file

impl iterator_file: Iterator (mut File) String Fs

Iterating through a File iterates through each line

source