Skip to content

FileHandle.writeLine

JoeStrout edited this page Nov 16, 2026 · 4 revisions

Write a string followed by a newline to the file; returns the number of bytes written (0 on error), or an error if the file is not open

Parameters

Parameter Default Value Note
data

Return value

Condition Return Value
(always) number

Notes

Example

import "file"
fh = file.open("log.txt", "w")
fh.writeLine "first line"
fh.writeLine "second line"
fh.close

Clone this wiki locally