Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
struct stat st;
dev_t dev = 773; /* device */
ino_t ino = 11321585;  /* file serial number */

FILE *fd = fopen(filename, "r");

if ( (fd) && 
     (fstat(fileno(fd), &st) != -1) &&
     (st.st_ino == ino) &&
     (st.st_dev == dev) 
     ) {
   ...
}
fclose(fd);

...