IO.Raw

wrappers for functions from the C standard library. Consider using a more carpesque function from IO when it exists. For detailed documentation please consult the documentation of your system (e.g. under Linux try man fprint).

EOF

external

Int

the End-Of-File character as a literal (thin wrapper for the C standard library)

SEEK-CUR

external

Int

to be used with fseek (thin wrapper for the C standard library).

SEEK-END

external

Int

to be used with fseek (thin wrapper for the C standard library).

SEEK-SET

external

Int

to be used with fseek (thin wrapper for the C standard library).

fclose

external

(Fn [(Ptr FILE)] Int)

closes a file pointer (thin wrapper for the C standard library).

fclose!

defn

(Fn [(Ptr FILE)] ())

                        (fclose! file)
                    

same as (fclose) but to be used as a side effect.

feof

external

(Fn [(Ptr FILE)] Bool)

ferror

external

(Fn [(Ptr FILE)] Bool)

fflush

external

(Fn [(Ptr FILE)] Int)

flushes a file pointer, i.e. commits every write (thin wrapper for the C standard library).

fflush!

defn

(Fn [(Ptr FILE)] ())

                        (fflush! file)
                    

same as (fflush) but to be used as a side effect.

fgetc

external

(Fn [(Ptr FILE)] Int)

gets a character from file (thin wrapper for fgetc from the C standard library).

fopen

defn

(Fn [(Ref String a), (Ref String b)] (Ptr FILE))

                        (fopen pathname mode)
                    

opens a file for input/output/appending (thin wrapper for the C standard library). Consider using the function IO.open-file instead.

fputc

external

(Fn [Int, (Ptr FILE)] Int)

writes a character to a file (thin wrapper for fputc from the C standard library).

fread

defn

(Fn [(Ref String a), Int, Int, (Ptr FILE)] Int)

                        (fread file-name item-size items-count file)
                    

reads from a file into C-String (thin wrapper for fread(cstr, item-size, items-count, file) from C standard library). Consider using read-file or unsafe-read-file instead.

fseek

external

(Fn [(Ptr FILE), Int, Int] Int)

sets the position indicator of a file (thin wrapper for fseek(file, offset, whence) from C standard library).

fseek!

external

(Fn [(Ptr FILE), Int, Int] ())

same as (fseek) but to be used as a side effect.

ftell

external

(Fn [(Ptr FILE)] Int)

gets the position indicator of a file (thin wrapper for the C standard library).

fwrite

defn

(Fn [(Ref String a), Int, Int, (Ptr FILE)] Int)

                        (fwrite data item-size items-count file)
                    

writes a C-string to a file and returns the number of written items (thin wrapper for the C standard library). Consider using write-file instead.

fwrite!

defn

(Fn [(Ref String a), Int, Int, (Ptr FILE)] ())

                        (fwrite! data item-size items-count file)
                    

like fwrite but returns no indicator whether writing to file succeeded. Consider using fwrite instead.

get-char

external

(Fn [] Int)

gets a character from stdin (thin wrapper for getchar() from C standard library).

rewind

external

(Fn [(Ptr FILE)] ())

rewinds a file pointer, i.e. puts input and output stream to beginning (thin wrapper for the C standard library). If you want to verify, that this succeeded, use (fseek stream 0, SEEK_SET) instead.

stderr

external

(Ptr FILE)

the standard error file (thin wrapper for the C standard library).

stdin

external

(Ptr FILE)

the standard input file (thin wrapper for the C standard library).

stdout

external

(Ptr FILE)

the standard output file (thin wrapper for the C standard library).

defn

(Fn [(Ref String a)] Int)

                        (unlink file-name)
                    

unlinks a file, i.e. deletes it (thin wrapper for POSIX api in <unistd.h>).

unlink!

defn

(Fn [(Ref String a)] ())

                        (unlink! file-name)
                    

same as (unlink) but to be used as a side effect.