mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-09-01 12:49:18 +02:00
Merge branch 'mover_in_c++' of https://github.com/tmj-fstate/maszyna into tmj-fstate-mover_in_c++
This commit is contained in:
@@ -294,10 +294,13 @@ bool FileExists( std::string const &Filename ) {
|
||||
}
|
||||
|
||||
// returns time of last modification for specified file
|
||||
time_t
|
||||
std::time_t
|
||||
last_modified( std::string const &Filename ) {
|
||||
|
||||
std::string fn = Filename;
|
||||
std::replace(fn.begin(), fn.end(), '\\', '/');
|
||||
struct stat filestat;
|
||||
if( ::stat( Filename.c_str(), &filestat ) == 0 ) { return filestat.st_mtime; }
|
||||
else { return 0; }
|
||||
if( ::stat( fn.c_str(), &filestat ) == 0 )
|
||||
return filestat.st_mtime;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user