Hello all,
I have to do a lot with binary data that is generated from a fortran
program and I’m using Ruby to do post processing of the data. To read a
block of data I’m using something like the following:
fmt = “x4 f#{nalt} x4 x4 f2 x4 x4 f4 x4”
where nalt is the number of points that are output in that record. Is
there a way to determine the number of bytes that are consumed by this
unpack statement? In particular, I’d like to have Ruby compute the
number of bytes I’m reading from the file so I don’t have to maintain
two different variables, one for the format and one for the number of bytes.
Thanks
Gordon