| United States-English |
|
|
|
![]() |
HP Pascal/HP-UX Programmer's Guide > Chapter 3 Input/Output Closing Files |
|
When your program closes a file, it breaks the association between the logical file and the physical file; therefore, it cannot access the file or file buffer variable. It must reopen the file before attempting to operate on it in any other way, or it is a run-time error. One way to close a file is with the predefined procedure close. A call to close has the following syntax and parameters. Syntax
Parameters
A program also closes a logical file and its associated physical file when the program:
Also, a program closes a file that is stored on the heap when it deallocates the file's heap space by calling the predefined procedure dispose or release with the appropriate parameter (see Chapter 6 “Dynamic Variables ”). A program closes a pre-existing physical file (one that it did not create) in the same state that it was in before the program opened it. If a program creates a file, however, it can specify the state in which the close procedure closes it. Example
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||