Skip to content

close_fileCloseFileCloseFileclose_fileT_close_file🔗

Short description🔗

close_fileCloseFileCloseFileclose_fileT_close_file — Closing a text file.

Signature🔗

close_file( file FileHandle )void CloseFile( const HTuple& FileHandle )static void HOperatorSet.CloseFile( HTuple fileHandle )def close_file( file_handle: MaybeSequence[HHandle] ) -> None

Herror T_close_file( const Htuple FileHandle )

static void HFile::CloseFile( const HFileArray& FileHandle )

void HFile::CloseFile( ) const

static void HFile.CloseFile( HFile[] fileHandle )

void HFile.CloseFile( )

Description🔗

The operator close_fileCloseFile closes a file which was opened via the operator open_fileOpenFile.

Execution information🔗

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🔗

FileHandlefileHandlefile_handle (input_control) file(-array) → (handle)HTuple (HHandle)HFile, HTuple (IntPtr)MaybeSequence[HHandle]Htuple (handle)

File handle.

Example🔗

(HDevelop)

open_file ('standard', 'output', FileHandle)
* ....
close_file(FileHandle)
(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)\;

Result🔗

If the file handle is correct close_fileCloseFile returns the value 2 (H_MSG_TRUE). Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

open_fileOpenFile

See also

open_fileOpenFile

Module🔗

Foundation