Writes the data to the file object or file path speficied using the charset specified or the java default character set if unspecified.

fileWrite(file, data [, charset]) → returns void

fileWrite Argument Reference

file any

A file object or a file system path string.

data String

The variable to write to the file.

charset String

An optional character set that the data is encoded with. Defaults to the Java default character set (which is usually UTF-8).

Examples sample code invoking the fileWrite function

Write a Temporary File

fileWrite( getTempFile( getTempDirectory(), "tempFile"), "My Data" );

Fork me on GitHub