ANSI C streams
Factor handbook ยป Input and output

Prev:Checksums
Next:Non-blocking I/O implementation


C streams are found in the io.streams.c vocabulary; they are Stream protocol implementations which read and write C FILE* handles.
<c-reader> ( handle -- stream )

<c-writer> ( handle -- stream )


Underlying primitives used to implement the above:
fopen ( path mode -- alien )

fwrite ( data length alien -- )

fflush ( alien -- )

fclose ( alien -- )

fputc ( byte alien -- )

fgetc ( alien -- byte/f )

fread-unsafe ( n buf alien -- count )


The three standard file handles:
stdin-handle ( -- alien )

stdout-handle ( -- alien )

stderr-handle ( -- alien )