[Coco] Coco Digest, Vol 45, Issue 34

carl j england mrspock12 at juno.com
Wed Apr 11 20:25:48 EDT 2007



OPEN"D",1,"FILENAME.BIN",1
FIELD#1,1ASA$
GET#1,LOF(4)
PRINTHEX$(ASC(A$))
GET#1,LOF(5)
PRINTHEX$(ASC(A$))
PRINT(LOF(1))
CLOSE

this will give you the beginning of any contiguous m/l file on the disk. 
if it is a segmented file it will only give you the beginning of the
first segment.  the length of the file will also be displayed (this will
be only an approximate length since it also includes the preamble and
postamble of the file, but this is usually good enough).  i have
(somewhere) a program that i wrote that will display all the segments of
a segmented file.  if you need it, i will write the program again. 
(would only take about 10 minutes--much less time than it would take to
find the original).  the preamble of a m/l disk file contains:

00
segment length (most significant byte)
segment length (least significant byte)
start address (most significant byte)
start address (least significant byte)

if the segment length is approximately equal to the length of the file
(actually 10 bytes less) then the file is not segmented; otherwise each
segment adds 5 bytes to the overhead.



More information about the Coco mailing list