Here are a few notes concerning the source code for i.landsat.tm:

Manifest for i.landsat.tm directory:

   landsat.c   	     main() and Parse()
   fileseq.c   	     read routines for tape and disk
   quadrant.c  	     import quadrant and full scenes
   fast.c      	     import fast format
   examine.c   	     print info about a scene
   rec_type.c  	     record type for quad and full scenes
   utils.c     	     misc stuff
   i.landsat.tm.man  manual page
   README      	     this file
   landsat.h
   fileseq.h

i.landsat.tm was developed and tested on a Sun Sparcstation 2 with
QIC-150 and 8mm tapes and on a Sun 3/160 with 1600 BPI 9-track tape.

All input from tape and disk is done through the routines in fileseq.c.
This is an attempt to isolate the input routines from the importers.
The import routines in quadrant.c and fast.c call the same routines in
fileseq.c for both tape and disk.

Reads from disk use buffered I/O; reads from tape use read().  The use
of ioctl() and buffered I/O could have sped things up greatly for
reading from tapes but may not be portable to all machines.
FileSeqRead() performs its own buffering.  All reading from tape is
done in the FileSeqNext() and FileSeqRead() routines in fileseq.c Look
here if you have problems.  These routines assume that tapes behave
like they do on Suns:

   read() returns 0 when EOF is reached on tape.  The next read() will
      read from the next file on tape
   read() sets errno when EOM is reached

It seems like some tapes from EOSAT don't match the file format
documentation perfectly, especially older tapes (maybe I need more
documents.)  When the -e option is used, some fields may not be found.
See the manual page for the file format documents I used.
