<file-writer> ( path encoding -- stream )
Factor handbook > Input and output > Reading and writing files

Prev:<file-reader> ( path encoding -- stream )
Next:<file-appender> ( path encoding -- stream )


Vocabulary
io.files

Inputs and outputs
patha pathname string
encodingan encoding descriptor
streaman output stream


Word description
Outputs an output stream for writing to the specified pathname using the given encoding. The file's length is truncated to zero.

Notes
Most code should use with-file-writer instead, to ensure the stream is properly disposed of after.

Errors
Throws an error if the file cannot be opened for writing.

Definition