FILE *outFile;
- struct mtop *eom, *sbm, *rewind;
+ struct mtop *eom, *sbm, *rewind, *setblck;
tape = open(filename, O_RDWR);
if(tape == -1) {
writeHeader(tape, fileSeqNum, filename);
+ setblck->mt_op = MTSETBLK;
+ setblck->mt_count = BLOCKSIZE;
+ stat = ioctl(tape, MTIOCTOP, &setblck);
+ if (stat == -1) {
+ msglog(LOG_ERR, "Could not go to the eon of the tape!\n");
+ exit(-2);
+ }
+
outFile = fdopen(tape, "wb");
+ setvbuf(outFile, 0, _IOFBF, BLOCKSIZE);
}
int closeTape(FILE *openTape, int tape, int numBlocks, const char *filename) {