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

Synopsis

fwrite <int> <int | float | string | vector>

fwrite is undoable, queryable, and editable.

The fwrite command writes the data argument in binary format to a file. Strings are written as ascii terminating with a NULL character.
Note that this should not be used for writing to a text file. If you wish to write out a text file, use fprint instead as it does not terminate the written string with a null character. Only use this for binary files.

Return value

None

In query mode, return type is based on queried flag.

Related

fclose, feof, fflush, fgetline, fgetword, fopen, fprint, fread, frewind, pclose, popen

MEL examples

// Write some data into a file
//
$exampleFileName = ( `internalVar -userTmpDir` + "example.tmp" );
$fileId=`fopen $exampleFileName "w"`;
fwrite $fileId "Hello there\n";
fclose $fileId;