1
0

dnix-traverse.c 624 B

12345678910111213141516171819202122232425262728293031323334
  1. #include <stdio.h>
  2. #include <unistd.h>
  3. #include <stdlib.h>
  4. #include <stdio.h>
  5. typedef unsigned long daddr_t;
  6. #include "diskpar.h"
  7. #include "inode.h"
  8. #include "sysfile.h"
  9. #include "dir.h"
  10. int main (int argc, char ** argv) {
  11. FILE * image_file;
  12. int opt;
  13. while ((opt = getopt(argc, argv, "d:")) != -1) {
  14. switch (opt) {
  15. case 'd':
  16. image_file = fopen (optarg, "r");
  17. if (image_file == NULL) {
  18. perror ("Failure opening file.");
  19. exit(EXIT_FAILURE);
  20. }
  21. break;
  22. default: /* '?' */
  23. fprintf(stderr, "Usage: %s [-d disk-image-file]\n", argv[0]);
  24. exit(EXIT_FAILURE);
  25. }
  26. }
  27. }