Difference between revisions of "Truxton file close"
Jump to navigation
Jump to search
(→Sample) |
|||
| (2 intermediate revisions by the same user not shown) | |||
| Line 4: | Line 4: | ||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
| − | void truxton_file_close( uint64_t file_handle ) | + | void truxton_file_close( uint64_t file_handle ); |
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
==<code>file_handle</code>== | ==<code>file_handle</code>== | ||
| − | |||
The handle created by the [[truxton_file_open_id]] or [[truxton_file_open_md5]] call. | The handle created by the [[truxton_file_open_id]] or [[truxton_file_open_md5]] call. | ||
=Sample= | =Sample= | ||
| − | + | <source lang="C" highlight="10"> | |
| − | < | + | int check_it( uint64_t truxton ) |
| − | int check_it(uint64_t truxton) | ||
{ | { | ||
| − | uint64_t file = truxton_file_open_id(truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000"); | + | uint64_t file = truxton_file_open_id( truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000" ); |
| − | if ( file | + | if ( file == 0 ) |
{ | { | ||
| − | return(0); | + | return( 0 ); |
} | } | ||
| − | truxton_file_close(file); | + | truxton_file_close( file ); |
| − | truxton_file_free(file); | + | truxton_file_free( file ); |
return(1) | return(1) | ||
} | } | ||
| − | </ | + | </source> |
Latest revision as of 05:53, 6 February 2026
Closes an opened file in Truxton.
This function merely closes access to the file's contents.
The object must be freed by calling truxton_file_free()
Contents
Syntax
void truxton_file_close( uint64_t file_handle );
Parameters
file_handle
The handle created by the truxton_file_open_id or truxton_file_open_md5 call.
Sample
int check_it( uint64_t truxton )
{
uint64_t file = truxton_file_open_id( truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000" );
if ( file == 0 )
{
return( 0 );
}
truxton_file_close( file );
truxton_file_free( file );
return(1)
}