I have serious problems with the stat () function. I have an application compiled under cygwin ond Windows 7 and the same application compiled with MSVC ++ in Windows 7. The application contains the following code:
struct stat stb;
memset( &stb, 0, sizeof( stb ) );
stat( szPath, &stb );
cout << hex << uppercase << setw(8) << stb.st_mtime << endl;
szPathis the path to the file. The file is not modified in any way by the application. The problem is that I get different results for some files. For instance:
cygwin version: 40216D72
MSVC++ version: 40217B82
The difference is always E10 = 3600 = 1 hour
Using google, I found this and it looks like the same thing I see. Is there any way how to fix this? I can not use any WinAPI calls. The simplest and most reliable solution is what I'm looking for, but if it should be complicated, so be it. Reliability and portability (win + linux) - the most important thing here.
source
share