next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc :: close

close -- close a file


f << close -- closes the file f.
close f -- closes the file f.

In the case of an output file, any buffered output is first written to the file, and the return value is an integer, normally 0, or -1 on error, or the return status of the child process in case the the file was a pipe.

If the file was open for both input and output, both directions are closed.

If the file is a pipe to another process, i.e., the filename began with the character !, we will wait for the process to terminate. If you don't want to wait for the process to terminate, open the file with openInOut, and if necessary, use closeIn to close it, to indicate that it has received all its input.

If the file is stdio then it is left open, and no error is signaled.

For the programmer

The object close is a manipulator.