FileClose

Closes an on-disk or in-memory file that is open.

Method Signature

FileClose(file=[any])

Arguments

Argument
Type
Required
Description
Default

file

any

true

The file to close.

Examples

Opens a file, reads a line then closes it.

// Open File
var fileObject = fileOpen( "/path/to/file.txt" );
// Perform Actions
try {
	// Read Line
	writeOutput( fileReadLine( fileObject ) );
}
// Error Handling
 catch (any ex) {
	// Report Exception
	writeDump( ex );
}finally {
	// Always Close
	// Close File
	fileClose( fileObject );
}

Additional Examples

testFile = fileopen("filepath"),"write");
filewriteline(testfile,"I am the example of fileclose");
fileclose(testfile);

Last updated

Was this helpful?