Esempio n. 1
0
static int __nextTraceFile( iOTraceData t ) {
  int i = 0;
  char* newfileName = NULL;
  long filetime = 0;
  int oldest = 0;
  for( i = 0; i < t->nrfiles; i++ ) {
    newfileName = __createNumberedFileName( i, t->file );
    if( __exist( newfileName ) ) {
      if( filetime == 0 ) {
        filetime = __fileTime( newfileName );
        oldest = i;
      }
      else if( __fileTime( newfileName ) < filetime ) {
        filetime = __fileTime( newfileName );
        oldest = i;
      }
    }
    else {
      oldest = i;
      i = t->nrfiles; /* break */
    }
    StrOp.free( newfileName );
  }
  return oldest;
}
Esempio n. 2
0
/*********************
return true if entry or group exists
*********************/
bool entry_exist(const char * table, const char * file, ...)
{
	bool ret;
	va_list ap;

	va_start(ap, file);
	ret = __exist(table, file, ap);
	va_end(ap);

	return ret;
}