- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OPEN (UNIT=7, FILE=BinFile, ACCESS='DIRECT', RECL=22000,
+ STATUS='OLD', FORM='UNFORMATTED')
Link Copied
- « Previous
- Next »
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I ran into this years ago when writing a VB6 program that need to read Fortran direct access files. There's a comment specific to
reading data from a file created by the lahey Compiler
Sub checklahey(filen)
'
' check the file open as filen to see if it is in
' Lahey binary format.
'
' Lahey files (unless the -nhed option is used) have an extra
' record in the front. The first byte of the extra
' record is F7 followed by the 2 byte record length
'
' if the file is not in lahey format, set laheyflag to 0
' otherwise set it to the record length
'
To read it as a stream I would compute the byte position by adding lahey flag, which would be 0 if not lahey format, or
the correct number of bytes to skip. Looks like I only had to handle 2 byte record lengths for this case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
"the lahey Compiler" is ambiguous. Lahey sold 16-bit , 32-bit and 64-bit compilers. Unless you know which of those compilers was used in producing the .BIN file that you are trying to read, and what that file is supposed to contain, you are faced with a possibly impossible task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe this is of help:
OPEN: RECL Specifier
The RECL specifier indicates the length of each record in a file connected for direct access, or the maximum length of a record in a file connected for sequential access.
The RECL specifier takes the following form:
RECL = rl
rl | Is a positive numeric expression indicating the length of records in the file. If necessary, the value is converted to integer data type before use. |
If the file is connected for formatted data transfer, the value must be expressed in bytes (characters). Otherwise, the value is expressed in 4-byte units (longwords). If the file is connected for unformatted data transfer, the value can be expressed in bytes if compiler option assume byterecl is specified.
Except for segmented records, the rl is the length for record data only, it does not include space for control information. If rl is too large, you can exhaust your program's virtual memory resources trying to create room for the record.
It might benefit you to look at the file with a hex editor to assure the file does NOT include record headers and trailers (e.g. record lengths).
Jim Dempsey

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
- Next »