I/O Methods

text

Supported By

Examples

open file "readme.txt" as "text"
open file "My To-Do List" as "MacRoman"
open file "AUTOEXEC.BAT" as "CP437"

Description

The text I/O method allows reading and writing as text. The variants read and written will be strings.

Notes

If the I/O method is specified as simply "text", the value of the textEncoding property is used to determine the text encoding to use. Otherwise, the name specified as the I/O method is used to determine the text encoding to use.

Reading something opened as text without specifying a length will result in reading characters up to and including the next line break. The text I/O method uses return&newline, newline, return, linesep, and parasep as possible line endings.

See Also

open, read, write, truncate, close