Difference between revisions of "Truxton file tell"
Jump to navigation
Jump to search
| Line 2: | Line 2: | ||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
int64_t truxton_file_tell( uint64_t file_handle ); | int64_t truxton_file_tell( uint64_t file_handle ); | ||
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
| Line 14: | Line 14: | ||
=Sample= | =Sample= | ||
| − | < | + | <source lang="C" highlight="12"> |
| − | int does_file_have_deep_philosophical_meaning(uint64_t truxton) | + | int does_file_have_deep_philosophical_meaning( 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 != 0 ) | if ( file != 0 ) | ||
{ | { | ||
| − | return(0); | + | return( 0 ); |
} | } | ||
| − | truxton_file_seek(file, 42, 0 ); | + | truxton_file_seek( file, 42, 0 ); |
| − | int64_t read_position = truxton_file_tell(file); | + | int64_t read_position = truxton_file_tell( file ); |
| − | truxton_file_close(file); | + | truxton_file_close( file ); |
| − | truxton_file_free(file); | + | truxton_file_free( file ); |
if ( read_position == 42 ) | if ( read_position == 42 ) | ||
{ | { | ||
| − | return(1); | + | return( 1 ); |
} | } | ||
| − | return(0) | + | return( 0 ) |
} | } | ||
| − | </ | + | </source> |
Latest revision as of 17:32, 10 February 2021
This tells you the offset into the opened file where the next read will take place.
Syntax
int64_t truxton_file_tell( uint64_t file_handle );
Parameters
file_handle
The handle created by the truxton_file_open_id or truxton_file_open_md5 call.
Return value
The offset into the file where the next byte will be read from.
Sample
int does_file_have_deep_philosophical_meaning( uint64_t truxton )
{
uint64_t file = truxton_file_open_id( truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000" );
if ( file != 0 )
{
return( 0 );
}
truxton_file_seek( file, 42, 0 );
int64_t read_position = truxton_file_tell( file );
truxton_file_close( file );
truxton_file_free( file );
if ( read_position == 42 )
{
return( 1 );
}
return( 0 )
}