Difference between revisions of "Truxton start adding files"
Jump to navigation
Jump to search
(→Sample) |
(→Sample) |
||
| (2 intermediate revisions by the same user not shown) | |||
| Line 2: | Line 2: | ||
=Syntax= | =Syntax= | ||
| − | < | + | <source lang="C"> |
| − | void truxton_start_adding_files( uint64_t | + | void truxton_start_adding_files( uint64_t truxton_handle ); |
| − | </ | + | </source> |
=Parameters= | =Parameters= | ||
==<code>truxton_handle</code>== | ==<code>truxton_handle</code>== | ||
| − | |||
The handle created by the [[truxton_create]] call. | The handle created by the [[truxton_create]] call. | ||
=Sample= | =Sample= | ||
| − | + | <source lang="C" highlight="3"> | |
| − | < | + | void add_folder( uint64_t truxton, uint64_t parent_file ) |
| − | void add_folder(uint64_t truxton, uint64_t parent_file) | ||
{ | { | ||
| − | truxton_start_adding_files(truxton) | + | truxton_start_adding_files( truxton ); |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | + | uint64_t child = truxton_child_file_new_child( parent_file ); | |
| − | + | truxton_child_file_set_type( child, Type_Directory ); | |
| + | truxton_child_file_set_name( child, "Custom Exploits Folder" ); | ||
| − | + | uint64_t now = truxton_time_now(); | |
| − | |||
| − | truxton_child_file_set_created(child, | + | truxton_child_file_set_created( child, now ); |
| − | truxton_child_file_set_accessed(child, | + | truxton_child_file_set_accessed( child, now ); |
| − | truxton_child_file_set_modified(child, | + | truxton_child_file_set_modified( child, now ); |
| − | truxton_child_file_set_origin(child, ORIGIN_GENERATED); | + | truxton_child_file_set_origin( child, ORIGIN_GENERATED ); |
| − | if ( truxton_child_file_save(child) == 0 ) | + | if ( truxton_child_file_save( child ) == 0 ) |
{ | { | ||
printf( "Failed to add child to Truxton\n" ); | printf( "Failed to add child to Truxton\n" ); | ||
} | } | ||
} | } | ||
| − | </ | + | </source> |
Latest revision as of 18:16, 13 April 2024
This tells the API that you are not an ETL process, you just want to add stuff to Truxton.
Contents
Syntax
void truxton_start_adding_files( uint64_t truxton_handle );
Parameters
truxton_handle
The handle created by the truxton_create call.
Sample
void add_folder( uint64_t truxton, uint64_t parent_file )
{
truxton_start_adding_files( truxton );
uint64_t child = truxton_child_file_new_child( parent_file );
truxton_child_file_set_type( child, Type_Directory );
truxton_child_file_set_name( child, "Custom Exploits Folder" );
uint64_t now = truxton_time_now();
truxton_child_file_set_created( child, now );
truxton_child_file_set_accessed( child, now );
truxton_child_file_set_modified( child, now );
truxton_child_file_set_origin( child, ORIGIN_GENERATED );
if ( truxton_child_file_save( child ) == 0 )
{
printf( "Failed to add child to Truxton\n" );
}
}