stat avec st_atime st_mtime st_ctime
Hello,
Je sais comment lire les informations concerant les fichiers et répertoires mais je ne sais pas comment modifier.
Code:
1 2 3 4 5 6 7 8 9 10 11
|
struct stat sts;
stat(fichier, &sts);
printf ( "Périphérique : %d\n", sts.st_dev);
printf ("Noeud : %ld\n", sts.st_ino);
printf ("Protection : %o\n", sts.st_mode);
printf ("nb liens matériels: %d\n", sts.st_nlink);
printf("annee : %d\n",sts.st_atime);
printf("mois : %d\n",sts.st_mtime);
printf("ctime : %d\n",sts.st_ctime); |
Là, ca affiche les infos, mais quand je veux faire une modification en faisant:
Code:
1 2
|
sts.st_ctime=sts.st_ctime-100000; //par exemple |
ca ne marche pas. comment se fait-il???
Merci infiniment