Handbook
Glossary
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
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 )
<file-reader>
stream-contents
;