Go to: Synopsis. Return value. Related. MEL examples.

Synopsis

fwriteAllText string string

fwriteAllText is NOT undoable, NOT queryable, and NOT editable.

The fwriteAllText command writes all text from a string to a file. Existing files will be overwritten.

Return value

intZero if success

Related

freadAllLines, freadAllText, fwriteAllLines

MEL examples

// Write text to a file
//
string $exampleFileName = ( `internalVar -userTmpDir` + "example.tmp" );
string $textToWrite = "Hello there\nMEL user\n";
int $result = fwriteAllText($exampleFileName,$textToWrite);