thanks
but i get 4 error and 2 warning when compling this sample code provided by MSDN in VC++ 6
Code:
// crt_stat.c
/* This program uses the _stat64 function to
* report information about the file named stat.c.
*/
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
int main( void )
{
struct __stat64 buf;
int result;
/* Get data associated with "crt_stat.c": */
result = _stat64( "crt_stat.c", &buf );
/* Check if statistics are valid: */
if( result != 0 )
perror( "Problem getting information" );
else
{
/* Output some of the statistics: */
printf( "File size : %ld\n", buf.st_size );
printf( "Drive : %c:\n", buf.st_dev + 'A' );
printf( "Time modified : %s", _ctime64( &buf.st_mtime ) );
}
}
d:\my documents\my c source\time.c(13) : error C2079: 'buf' uses undefined struct '__stat64'
d:\my documents\my c source\time.c(17) : warning C4013: '_stat64' undefined; assuming extern returning int
d:\my documents\my c source\time.c(25) : error C2224: left of '.st_size' must have struct/union type
d:\my documents\my c source\time.c(26) : error C2224: left of '.st_dev' must have struct/union type
d:\my documents\my c source\time.c(27) : warning C4013: '_ctime64' undefined; assuming extern returning int
d:\my documents\my c source\time.c(27) : error C2224: left of '.st_mtime' must have struct/union type
Error executing cl.exe.
2) If the program above works ... how to compare which file is newer.. since the Time modified is in string format....