[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] What's the format of TrafficTrace file



I thought the tracefile should be binary? If you look what that piece of
code is doing, it's checking if the file size is multiples of tracerec,
which are 2 integers. Perhaps you want to write raw binary data to your
trace file instead of ascii

On Tue, 29 Feb 2000, Ken Pounds wrote:

> Thanks to Yu Haobo, but I cant get the simulation run yet.
> The error is:
> bad file size in Tracefile
> 
> My tracefile is created with 
> fprintf(ofp,"%x %x \n",tre.trec_time,tre.trec_size);
> 
> It seems that problem is in TrafficTrace.cc: 
> 		nrec_ = buf.st_size/sizeof(tracerec);
> 
> 		if (nrec_ * sizeof(tracerec) != buf.st_size) {
> 			printf("bad file size in %s\n", name_);
> 			return -1;
> 		}
> However, I use a small program to test my tracefile, nrec_ and
> buf.st_size is ok.
> 
> What's the trick?
> 
> 
> 
> 
>