+#endif /* DEBUG_QFA */
+ break;
+#ifdef USE_QFA
+ case 'P':
+#ifdef DEBUG_QFA
+ tistart = time(NULL);
+#endif
+#ifdef sunos
+ if (GetSCSIIDFromPath(inputdev, &scsiid)) {
+ errx(1, "can't get SCSI-ID for %s\n", inputdev);
+ }
+ if (scsiid < 0) {
+ errx(1, "can't get SCSI-ID for %s\n", inputdev);
+ }
+ sprintf(smtcpath, "/dev/rsmtc%ld,0", scsiid);
+ if ((fdsmtc = open(smtcpath, O_RDWR)) == -1) {
+ errx(1, "can't open smtc device: %s, %d\n", smtcpath, errno);
+ }
+#endif /* sunos */
+ setup();
+ msg("writing QFA positions to %s\n", gTapeposfile);
+ (void) umask(orig_umask);
+ if ((gTapeposfd = open(gTapeposfile, O_WRONLY|O_CREAT|O_TRUNC,
+ S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP
+ |S_IROTH|S_IWOTH)) < 0)
+ errx(1, "can't create tapeposfile\n");
+ (void) umask(FORCED_UMASK);
+ /* print QFA-file header */
+ sprintf(gTps, "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION, (unsigned long)spcl.c_date);
+ if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
+ errx(1, "can't write tapeposfile\n");
+ sprintf(gTps, "ino\ttapeno\ttapepos\n");
+ if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
+ errx(1, "can't write tapeposfile\n");
+
+ extractdirs(1);
+ initsymtable((char *)0);
+ for (;;) {
+ NEXTFILE(p);
+ if (!p)
+ break;
+ canon(p, name, sizeof(name));
+ ino = dirlookup(name);
+ if (ino == 0)
+ continue;
+ if (mflag)
+ pathcheck(name);
+ treescan(name, ino, addfile);
+ }
+ createfiles();
+#ifdef sunos
+ if (fdsmtc != -1) {
+ close(fdsmtc);
+ }
+#endif /* sunos */
+#ifdef DEBUG_QFA
+ tiend = time(NULL);
+ titaken = tiend - tistart;
+ msg("writing QFA positions took %d:%02d:%02d\n", titaken / 3600,
+ (titaken % 3600) / 60, titaken % 60);
+#endif /* DEBUG_QFA */