close_fileT_close_fileCloseFileCloseFileclose_file (Operator)
Name
close_fileT_close_fileCloseFileCloseFileclose_file
— Closing a text file.
Signature
def close_file(file_handle: MaybeSequence[HHandle]) -> None
Description
The operator close_fileclose_fileCloseFileCloseFileCloseFileclose_file
closes a file which was opened
via the operator open_fileopen_fileOpenFileOpenFileOpenFileopen_file
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
FileHandleFileHandleFileHandleFileHandlefileHandlefile_handle
(input_control) file(-array) →
HFile, HTupleMaybeSequence[HHandle]HTupleHtuple (handle) (IntPtr) (HHandle) (handle)
File handle.
Example (HDevelop)
open_file ('standard', 'output', FileHandle)
* ....
close_file(FileHandle)
Example (C)
create_tuple(&FileHandle,0);
create_tuple_s(&name,"standard");
create_tuple_s(&type,"output");
open_file(name,type,&FileHandle);
destroy_tuple(name);
destroy_tuple(type);
/* ... */
/* close the file */
destroy_tuple(FileHandle);
Example (HDevelop)
open_file ('standard', 'output', FileHandle)
* ....
close_file(FileHandle)
Example (HDevelop)
open_file ('standard', 'output', FileHandle)
* ....
close_file(FileHandle)
Example (HDevelop)
open_file ('standard', 'output', FileHandle)
* ....
close_file(FileHandle)
Result
If the file handle is correct
close_fileclose_fileCloseFileCloseFileCloseFileclose_file
returns the value 2 (
H_MSG_TRUE)
.
Otherwise an exception is raised.
Possible Predecessors
open_fileopen_fileOpenFileOpenFileOpenFileopen_file
See also
open_fileopen_fileOpenFileOpenFileOpenFileopen_file
Module
Foundation