Truxton file exists

From truxwiki.com
Revision as of 09:05, 17 January 2021 by Sam (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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);
   }
}