Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Sep 1997 14:19:30 -0700 (PDT)
From:      "Brian N. Handy" <handy@sag.space.lockheed.com>
To:        hackers@freebsd.org
Subject:   Tape question
Message-ID:  <Pine.OSF.3.96.970902141656.16187M-100000@sag.space.lockheed.com>

next in thread | raw e-mail | index | archive | help
Heya folks,

I've got a guy here who's got a pile of data on exabyte tapes, and he's
written a C program to read the stuff off the tapes and do [mumble I
don't know] with it.

What follows is his brief description of the problem.  If anyone has any
comments or suggestions I'd like to hear them.  I can come up with some
sample code if this isn't sufficient.

Thanks,

Brian

---------- Forwarded message ----------
The problem is easily described:

- The Exabyte tapes to be read have a variable (logical) block size,
  it typically is 8192 bytes, but often shorter.

- My original c program always attempted to read a 8192 byte block:

  nn = read(unit,buffer,8192);

- On the sun this worked, it would read one (logical) block, and
  return the actual number of bytes read.

- In FreeBSD this created unpredictable results, if the logical block
  was shorter than 8192.  I don't know how much it actually read, but
  there certainly was a discrepancy between the number of bytes read,
  and the number returned.  Also, running the program twice on the
  same data created different results.

- In my particular case a fix was possible, since the actual logical
  block size can be predicted by an algorithm:

  nn = read(unit,buffer,predicted_block_size);

  But such a thing shouldn't be necessary.  It defeats the idea of
  a variable block size format.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.OSF.3.96.970902141656.16187M-100000>