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


fwrite int int|float|string|vector

fwrite is NOT undoable, NOT queryable, and NOT 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



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;