RedFox4AIX
IS-IT--Management
Hi , could anybody tell me is there any command in solaris to show a file 's create time, access time, and modify time just like istat in aix?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
int main(int argc, char ** argv)
{
struct stat filestats;
if ( argc != 2 )
{
fprintf(stderr, "filedates: incorrect number of parameters!\n");
return( -1 );
}
if( stat(argv[1], &filestats) )
{
fprintf(stderr, "filedates: Couldn't get file stats for %s!\n", argv[1]);
return( -1 );
}
printf(" File Name: %s\n", argv[1]);
printf(" Size: %ld\n", filestats.st_size);
printf(" Last Access Time: %s", asctime(localtime(&filestats.st_atime)));
printf(" Last Mod Time: %s", asctime(localtime(&filestats.st_mtime)));
printf("Last Stat Chg Time: %s", asctime(localtime(&filestats.st_ctime)));
return(0);
}