Difference between revisions of "Truxton file open id"
Jump to navigation
Jump to search
(Created page with "This retrieves entropy of the file contents. =Syntax= <syntaxhighlight lang="C"> uint64_t truxton_file_open_id( uint64_t truxton_handle, char const * guid_string ) </syntaxhi...") |
(→Sample) |
||
| Line 21: | Line 21: | ||
=Sample= | =Sample= | ||
| − | <syntaxhighlight lang="C" highlight=" | + | <syntaxhighlight lang="C" line highlight="3"> |
| − | + | int check_it(uint64_t truxton) | |
{ | { | ||
| − | + | uint64_t file= truxton_file_open_id(truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000"); | |
| − | + | if ( file != 0 ) | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | if ( | ||
{ | { | ||
| − | + | return(0); | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
} | } | ||
| − | + | truxton_file_close(file); | |
| + | |||
| + | return(1) | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 09:18, 1 June 2020
This retrieves entropy of the file contents.
Syntax
uint64_t truxton_file_open_id( uint64_t truxton_handle, char const * guid_string )
Parameters
truxton_handle
The handle created by the truxton_create call.
guid_string
The string representation of the identifier of the file to get in Truxton.
This corresponds to the ID column of the File table.
Return value
A handle to a read-only file in Truxton.
Sample
1 int check_it(uint64_t truxton)
2 {
3 uint64_t file= truxton_file_open_id(truxton, "5ed3aeb7-3da4-5f5c-8c8f-af5200000000");
4
5 if ( file != 0 )
6 {
7 return(0);
8 }
9
10 truxton_file_close(file);
11
12 return(1)
13 }