From: hades Date: Thu, 18 May 2000 16:51:05 +0000 (+0000) Subject: Set buffer size implemented. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=5e3b39d3f666cb43ee00315df41d0d609d943715;p=daqdata.git Set buffer size implemented. --- diff --git a/hadaq/hwtape.c b/hadaq/hwtape.c index 23c923c..8243e41 100644 --- a/hadaq/hwtape.c +++ b/hadaq/hwtape.c @@ -35,7 +35,7 @@ static FILE *openTape(const char* filename) { FILE *outFile; - struct mtop *eom, *sbm, *rewind; + struct mtop *eom, *sbm, *rewind, *setblck; tape = open(filename, O_RDWR); if(tape == -1) { @@ -89,7 +89,16 @@ static FILE *openTape(const char* filename) { 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) {