file.write

Syntax file.write (path, value)

Params path is the path name of the file to which you wish to append data.

value is the binary value to be appended to the file at path.

Action Writes value in binary form to the end of the file at path.

Returns True

Examples file.write ("C:\\Program Files\\Frontier\\sample.txt", "More sample text")

   » true


file.write ("System:Sample Data File", 20)

   » true

The number 20 is written value to the end of the file as 4 bytes of binary data.

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.write operation, an error will result.

Notes The value being written to the file at path will be coerced to a binary datatype before being written.

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.writeWholeFile

file.writeLine

file.read

file.open

file.close

Discuss