Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. #include <sys/stat.h>
  5. #include <sys/types.h>
  6.  
  7. #include <time.h>
  8.  
  9. #include <unistd.h>
  10. #include <fcntl.h>
  11.  
  12. int main (int argc, char *argv[])
  13. {
  14. struct stat fileStat;
  15. int OO=0;
  16. FILE *filename = argv[1];
  17.  
  18. if((OO = open(filename , O_RDONLY))== -1)
  19. {
  20. printf("Erreur d'ouverture du fichier");
  21. return EXIT_FAILURE;
  22. }
  23.  
  24. if(fstat(OO, &fileStat)<0)
  25. {
  26. return 1;
  27. }
  28.  
  29. printf("Numéros d'inode : \t\t%d\n",fileStat.st_ino);
  30. printf("Date de création du fichier: \t%s\n", ctime(&fileStat.st_ctime));
  31.  
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement