#include <stdio.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <time.h>

int main(int argc, char ** argv){
  struct stat buf;
  stat(argv[1],&buf);
  printf("Numero d'i-noeud : %d\n",buf.st_ino);
  printf("Numero peripherique : %d\n",buf.st_dev);
  if(S_ISDIR(buf.st_mode))printf("Repertoire\n");
  if(S_ISREG(buf.st_mode))printf("Fichier regulier\n");
  if(S_ISBLK(buf.st_mode))printf("Block d'octets\n");
  printf("Nombre de liens : %d\n",buf.st_nlink);
  printf("Taille (en octets) : %d\n",buf.st_size);
  printf("Nombre de blocs : %d\n",buf.st_blocks);
  char * m = ctime(buf.st_mtime);
  printf("Date m : %s\n",m);
  printf("Date a : %s\n",buf.st_atime);
  printf("Date c : %s\n",buf.st_ctime);
}

