std::time_t modified () const { const std::string fullpath = m_path + m_name; return file_modified(fullpath); }
std::time_t modified() const { StringOutputStream fullpath(256); fullpath << m_path.c_str() << m_name.c_str(); return file_modified(fullpath.c_str()); }
const char * getversion(void) { if (*version_string) return version_string; #if SYS_UNIX || SYS_VMS /* * We really would like to have the date at which this program was * linked, but a.out doesn't have that in general. COFF files do. * Getting the executable's modification-time is a reasonable * compromise. */ (void) lsprintf(version_string, "%s %s%s for %s", prognam, version, VILE_PATCHLEVEL, opersys); { char *s; if ((s = cfg_locate(prog_arg, (FL_EXECDIR | FL_PATH) | FL_EXECABLE)) != NULL) { time_t mtime = file_modified(s); if (mtime != 0) { (void) vl_strncat(version_string, ", installed ", NSTRING); (void) vl_strncat(version_string, ctime(&mtime), NSTRING); /* trim the newline */ version_string[strlen(version_string) - 1] = EOS; } } } #else # if SYS_MSDOS || SYS_OS2 || SYS_WINNT # if defined(__DATE__) && !SMALLER (void) lsprintf(version_string, "%s %s%s for %s, built %s %s with %s", prognam, version, VILE_PATCHLEVEL, opersys, __DATE__, __TIME__, # if CC_WATCOM "Watcom C/386" # endif # if CC_DJGPP # if __DJGPP__ >= 2 "DJGPP v2" # else "DJGPP" # endif # endif # if CC_TURBO # ifdef __BORLANDC__ "Borland C++" # else "Turbo C" # endif # endif # if CC_CSETPP # if __IBMC__ >= 300 "VisualAge C++" # else "IBM C Set ++" # endif # endif # if CC_LCC_WIN32 "Lcc-win32" # endif # if CC_MSVC "Visual C++" # endif # if __GNUC__ # if defined(__CYGWIN32__) "Cygwin gcc" # elif SYS_MINGW "MinGW gcc" # else "gcc" # endif # endif ); # endif # endif /* SYS_MSDOS || SYS_OS2 || SYS_WINNT */ #endif /* not SYS_UNIX or SYS_VMS */ return version_string; }