Writes data out to a file.
|Format||CNSImage_File_Write ( Data ; File ; FileExistsAction ; CharacterSet ; LineEndingType ; IncludeUnicodeBOM )|
The data to write.
The path and file name of the file to write.
The character set for the file. [Default is UTF-8.]
If True, and the character set is a unicode set, and the file is being created, this will include a unicode byte order mark. [Default is False.]
- Example 1
Writes the data "My Data" to the "Data.txt" file.
CNSImage_File_Write ( "My Data" ; "~/Desktop/Data.txt" )
- Example 2
Writes the data "My Data" to the "Data.txt" file and overwrites the file if it already exists.
CNSImage_File_Write ( "My Data" ; "C:\Users\Bob\Desktop\Data.txt" ; "Overwrite" )
- Example 3
Creates a new "Data.txt" file with the data "My Data" in it and backs up the existing "Data.txt" file. It also writes a unicode BOM to the file.
CNSImage_File_Write ( "My Data" ; "~/Desktop/Data.txt" ; "Backup" ; "" ; "" ; True )