Go to: Return value. Related commands. Examples.

Synopsis

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

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

Related commands

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

Examples


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