Closing files

Because the number of possible file handles is restricted in OS/2 sessions, you should always close every file you've opened as soon as possible. You also need to close a file (and perhaps reopen it again) if you want to call another program to write into or read from this file.

You should only use

 
  rc = STREAM( filename , "c", "CLOSE" )

to close a file. The other method that is sometimes used, using LINEOUT or CHAROUT without the second parameter, is only valid for files to which you have write access (even if you've only read from the file) (?).

Note: See also Output & Input control