in reply to Re: Opening certain files
in thread Opening certain files

I certainly would consider that approach in, for example, a module that might be deployed on different computers.   If you know that the file layout is (and will forever remain) stable, as will the source of that data file, then you might reasonably get away with using pack/unpack, which of course is designed expressly for this sort of thing.

Any such program should aggressively check for errors in the input, particularly any which imply that the unpack-information does not coincide with the data.   Realistically, only the computer itself can guard against “garbage in, garbage out stay forever” in this case.   The input program is the entire system’s first line of defense, and so it should treat every record as “Fubar until proven otherwise.”   (The “inefficiency” (sic) of doing this should be of no concern whatever.)