- if (tapepos) {
- msg("writing QFA positions to %s\n", gTapeposfile);
- if ((gTapeposfd = open(gTapeposfile,
- O_WRONLY|O_CREAT|O_TRUNC,
- S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP
- | S_IROTH | S_IWOTH)) < 0)
- quit("can't open tapeposfile\n");
- /* print QFA-file header */
- snprintf(gTps, sizeof(gTps), "%s\n%s\n%ld\n\n", QFA_MAGIC, QFA_VERSION, (unsigned long)spcl.c_date);
- gTps[sizeof(gTps) - 1] = '\0';
- if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
- quit("can't write tapeposfile\n");
- sprintf(gTps, "ino\ttapeno\ttapepos\n");
- if (write(gTapeposfd, gTps, strlen(gTps)) != (ssize_t)strlen(gTps))
- quit("can't write tapeposfile\n");
- }