title: Printing info of a file/director (inode)
body: <p>I want to print some information of a directory. My code is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;fcntl.h&gt;
  #include &lt;unistd.h&gt;
  #include &lt;sys/types.h&gt;
  #include &lt;sys/stat.h&gt;
  #include &lt;dirent.h&gt;
  #include &lt;time.h&gt;
  #include &lt;string.h&gt;
  
  int main (int argc, char *argv[])
  {
      struct stat fileStat;
      int fd=0;
      if ( ( fd = open (argv[1] , O_RDONLY) ) == -1){
          perror ( "open " );
          exit (1) ;
      }
  
      if(fstat(fd, &amp;fileStat)&lt;0) return 1;
  
      printf("Information for %s\n",argv[1]);
      printf("---------------------------\n");
      ---&gt;printf("File Size: \t\t%d bytes\n",fileStat.st_size);
      printf("Number of Links: \t%d\n",fileStat.st_nlink);
      ---&gt;printf("File inode: \t\t%d\n",fileStat.st_ino);
  
      return 0;
  }
  </code></pre>
  
  <p>I'm getting some warnings:</p>
  
  <pre><code>inode_test.c:24:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__off_t’ [-Wformat]
  
  inode_test.c:26:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘__ino_t’ [-Wformat]
  </code></pre>
  
  <p>Arrows show the line of each warning. Can you help? Thanks in advance!</p>