forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Opening a binary file (unknown record length)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2554
Location: Sydney

PostPosted: Mon Feb 01, 2016 1:22 pm    Post subject: Reply with quote

mecej4,

Many years ago I wrote a variable length record, random access file library, emulating the library available on 70's CDC Fortran that I used. This is based on the Fortran direct access file, using the fixed length records as buffers for the variable length records. It migrated from FTN IV to F77 and F95.
The library creates a record format structure, like a sequential access binary file, plus an pointer table to the file address of each virtual record.
For what you described, it can be provided by a similar library routine approach.
I have not found the FTN95 rules of direct access a problem. For the problem of record length being discussed, I could open the supplied file for transparent/stream access and create a temporary direct access file of the appropriate fixed record size. The fixed record length is often selected based on a consideration of buffering. After all, you do need some prior knowledge of the structure and position of information in the file.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group