@FILEWRITE[n,text]: Writes a line to the file whose handle is n. Returns the number of bytes written, or "-1" if an error occurred. n must be a handle returned by @FILEOPEN; or 1 (for standard output) or 2 (for standard error).
Be sure to read the cautionary note about file functions under Variable Functions.