#include #include #include #include int main(int argc, char *argv[]) { struct stat fbuf; int x; if(argc != 2) { puts("Error! Format:"); puts("FILEINFO filename"); return(1); } x = stat(argv[1],&fbuf); if(x != 0 ) { puts("Error reading file"); return(1); } printf("Some file stats on '%s':\n",argv[1]); printf("File size is %d bytes\n",fbuf.st_size); printf("File last modified %s\n",ctime(&fbuf.st_mtime)); return(0); }