file-contents ( path encoding -- seq )
Factor handbook » Input and output » Reading and writing files

Prev:<file-appender> ( path encoding -- stream )
Next:set-file-contents ( seq path encoding -- )


Vocabulary
io.files

Inputs
patha pathname string
encodingan encoding descriptor


Outputs
seqa sequence


Word description
Opens the file at the given path using the given encoding, and the contents of that file as a sequence.

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

See also
set-file-lines, file-lines, change-file-lines, set-file-contents, change-file-contents

Definition