TMCloseFile Overview Group

The TMCloseFile API call closes the file specified by the file handle 'file_handle'. All files that have been opened for reading with TMOpenFile or created for writing with TMCreateFile must be closed after use.

short far pascal TMCloseFile(

long session_handle,    // session handle for the desired 1-Wire network
void far *state_buffer, // state buffer provided for the 1-Wire network session
short file_handle       // file handle

For a description of the above types, see the TMEX Type Descriptions.



Specifies the session handle returned from the API function TMExtendedStartSession that specifies the desired 1-Wire network port. This parameter is required by most TMEX API functions.


Specifies a pointer to a memory location that TMEX keeps all of the state information for the 1-Wire networks. This parameter is required by most TMEX API functions.


Specifies a file handle to release from use.

Return Value

1 => file closed

<0 => TMEX File Operations Error Return Code

Code Example

See Also

TMCreateFile, TMOpenFile