file-lines ( path encoding -- seq ) (original) (raw)

Vocabulary
io.files

Inputs

path a pathname string
encoding an encoding descriptor

Outputs

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

Examples

USING: io.files io.encodings.utf8 prettyprint sequences ; "resource:core/kernel/kernel.factor" utf8 file-lines first .
"! Copyright (C) 2004, 2009 Slava Pestov."

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

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

Definition