Repository navigation
dos_writetextfile
Dale Fugier edited this page Jul 1, 2026
·
1 revision
Writes a list of strings to a text file. ANSI, UTF-8 and Unicode encoded text files are supported.
(dos_writetextfile [filename strings [append [encoding]])
filename
The name of the text file to write
strings
The array of strings to write.
append
If omitted or nil, the file will be overwritten if it already exists. If T, then the will be appended to if it already exists.
encoding
The text file encoding, where: 0 = ANSI Encoding (default), 1 = UTF-8 Encoding, and 2 = Unicode Encoding.
The number of lines written to the text file if successful.
nil on error.
Command: (setq strings (list "The quick brown fox" "jumped over the lazy dog."))
("The quick brown fox" "jumped over the lazy dog.")
Command: (dos_writetextfile "test.txt" strings)
2