file.writeLine

Syntax file.writeLine (path, lineString)

Params path is a legal path name to the file to which you wish to append text.

lineString is a string containing the characters to be written to the file.

Action Writes lineString and a carriage return at the end of the file identified by path.

Returns True if the write is successful, false if the file doesn't exist or if path identifies a folder.

Examples file.writeLine ("C:\\Program Files\\Frontier\\sample.txt", "Even more sample text")

   » true


file.writeLine ("System:tmp", "You're not the only one with mixed emotions.")

   » true

file.writeLine ("System:non-existent file", "Nothing will happen!")

   » false

In this example, the file you want to write to must have been previously created.

Errors If the file cannot be opened for writing because, for example, another application already has it open, or the file does not exist, an error will result.

If the disk is full or becomes full during the file.writeLine operation, an error will result.

Notes It is not necessary to open the file before writing to it -- the file will be opened and closed automatically. However, if many write operations are to be performed, calling file.open beforehand and file.close afterwards will improve performance.

See Also file.write

file.readLine

file.open

file.close

file.new

Discuss