16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-09-01 11:39:18 +02:00

Merge branch 'tmj-dev' into lua

This commit is contained in:
milek7
2017-10-31 21:54:16 +01:00
6 changed files with 84 additions and 23 deletions

View File

@@ -13,6 +13,17 @@ Copyright (C) 2007-2014 Maciej Cierniak
*/
#include "stdafx.h"
#include "mctools.h"
#include <sys/types.h>
#include <sys/stat.h>
#ifndef WIN32
#include <unistd.h>
#endif
#ifdef WIN32
#define stat _stat
#endif
#include "Globals.h"
/*================================================*/
@@ -281,3 +292,12 @@ bool FileExists( std::string const &Filename ) {
std::ifstream file( fn );
return( true == file.is_open() );
}
// returns time of last modification for specified file
time_t
last_modified( std::string const &Filename ) {
struct stat filestat;
if( ::stat( Filename.c_str(), &filestat ) == 0 ) { return filestat.st_mtime; }
else { return 0; }
}

View File

@@ -158,3 +158,6 @@ bool
extract_value( bool &Variable, std::string const &Key, std::string const &Input, std::string const &Default );
bool FileExists( std::string const &Filename );
// returns time of last modification for specified file
time_t last_modified( std::string const &Filename );