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

Vocabulary
io.files

Inputs

path a pathname string
encoding an encoding descriptor

Outputs

seq a 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

USING: io ;

IN: io.files

: file-contents ( path encoding -- seq )
stream-contents ;