size_t outputlen = strlen(yukonGlobal.output); if ( yukonGlobal.output[outputlen - 1] == '/' ) { /* we consider the string to be a directory only if it * ends with '/' */ /* generate a filename of the form: executable_date_time.seom */ time_t tim = time(NULL); struct tm *tm = localtime(&tim); snprintf(yukonGlobal.output+outputlen, OUTPUT_LENGTH-outputlen, "%s_%d-%02d-%02d_%02d:%02d:%02d.seom", executableName, tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec); }