Go to: Return value. Related commands. Examples.

Synopsis

fclose <int>

This command must be called with the file identifier returned by fopen after all file input/output is completed.

Return value

int

Related commands

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

Examples

 
	// Write some data to a file and then close it
	//
	$exampleFileName = ( `internalVar -userTmpDir` + "example.tmp" );
	$fileId=`fopen $exampleFileName "w"`;
	fprint $fileId "Hello there\n";
	fclose $fileId;