1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include<sys/types.h>
#include <unistd.h>
#include<time.h>
int main (int nb_args, char * args [])
{
struct stat sts;
char *c=malloc(20*sizeof(char));
/*if (nb_args != 2) {
fprintf (stderr, "syntaxe : %s <fichier>\n", args [0]);
exit (1);
}*/
if ( stat (nom, & sts) != 0) {
printf ("Erreur le fichier n'existe pas\n");
exit (1);
}
printf("derniere modif :%lu %lu\n ",sts.st_mtime,sts.st_atime);
} |
Partager