file-lines ( path encoding -- seq )
Factor documentation > Factor handbook > Input and output > Reading and writing files
Prev:set-file-contents ( seq path encoding -- )
Next:set-file-lines ( seq path encoding -- )


Vocabulary
io.files

Inputs and outputs
patha pathname string
encodingan encoding descriptor
seqan array of strings


Word description
Opens the file at the given path using the given encoding, and returns a list of the lines in that file.

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

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

Definition
USING: io ;

IN: io.files

: file-lines ( path encoding -- seq )
<file-reader> stream-lines ;