updating oE write_lines
write_lines
include io.e namespace io public function write_lines(object file, sequence lines)
write a sequence of lines to a file.
Parameters:
- file : an object, either a file path or the handle to an open file.
- lines : the sequence of lines to write
Returns:
An integer, 1 on success, -1 on failure.
Errors:
If puts cannot write some line of text, a runtime error will occur.
Comments:
If file was a sequence, the file will be closed on completion. Otherwise, it will remain open, but at end of file.
Whatever integer the lines in lines holds will be truncated to its 8 lowest bits so as to fall in the 0..255 range.
Example 1:
if write_lines("data.txt", {"This is important data", "Goodbye"}) != -1 then puts(STDERR, "Failed to write data\n") end if
See Also:
Not Categorized, Please Help
|