ficlose

ficlose — Closes a previously opened file.

Description

ficlose can be used to close a file which was opened with fiopen.

Syntax

ficlose ihandle
ficlose Sfilename

Initialization

ihandle -- a number which identifies this file (generated by a previous fiopen).

Sfilename -- A string in double quotes or string variable with the filename. The full path must be given if the file directory is not in the system PATH and is not present in the cuurrent directory.

Performance

ficlose closes a file which was previously opened with fiopen. ficlose is only needed if you need to read a file written to during the same csound performance, since only when csound ends a performance does it close and save data in all open files. The opcode ficlose is useful for instance if you want to save presets within files which you want to be accesible without having to terminate csound.

[Note] Note

If you don't need this functionality it is safer not to call ficlose, and just let csound close the files when it exits.

If a files closed with ficlose is being accessed by another opcode (like fout or foutk, it will be closed later when it is no longer being used.

[Warning] Warning

This opcode should be used with care, as the file handle will become invalid, and will cause an init error when an opcode tries to access the closed file.

See Also

fout, fout, fouti, foutir, foutk

Credits

Author: Gabriel Maldonado
Italy
1999

New in Csound version 5.02