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 and outputs
patha pathname string
encodingan encoding descriptor
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