Difference between revisions of "Truxton file exists"

From truxwiki.com
Jump to navigation Jump to search
(Created page with "This returns non-zero if the file's identifier exists in the <code>[ID]</code> column of the <code><nowiki>[</nowiki>File<nowiki>]</nowiki></code> table. =Synt...")
 
 
Line 21: Line 21:
 
=Sample=
 
=Sample=
 
<source lang="C" highlight="3">
 
<source lang="C" highlight="3">
void wait_for_file(uint64_t truxton, char const * id)
+
void wait_for_file( uint64_t truxton, char const * id )
 
{
 
{
 
   while( truxton_file_exists( truxton, id ) == 0 )
 
   while( truxton_file_exists( truxton, id ) == 0 )

Latest revision as of 17:26, 10 February 2021

This returns non-zero if the file's identifier exists in the [ID] column of the [File] table.

Syntax

int truxton_file_exists( uint64_t truxton_handle, char const * file_id_string );

Parameters

truxton_handle

The handle created by the truxton_create call.

file_id_string

A GUID in string form. This value must match the [ID] column of the [File] table. The file identifier is not random.

Return value

A non-zero when this file record exists in the [File] table. Zero when no record in the [File] table has a value in the [ID] column that matches file_id_string.

Sample

void wait_for_file( uint64_t truxton, char const * id )
{
   while( truxton_file_exists( truxton, id ) == 0 )
   {
      sleep(10);
   }
}