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

Vocabulary
io.files

Inputs

seq an array of strings
path a pathname string
encoding an encoding descriptor

Outputs
None

Word description
Sets the contents of a file to the strings with the given encoding.

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

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

Definition

USING: io sequences ;

IN: io.files

: set-file-lines ( seq path encoding -- )
[ [ print ] each ] with-file-writer ;