- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am reading a binary file using the open command. After reading the header I know the structure of the file. The actual data in the file which I am interested in is not stored sequentially so I have to read part of the data, change the current file position using fseek, and then read some more, and so on.
My program works as intended. If I read from my local hard drive it reads very quickly. If I read from the network it is much much slower. I presume this is becasue a request needs to be made everytime I read a bit more data (which I do a lot, so it really is a very big performance hit)
Is it possible to read the entire binary file into memory first, and then access the data using the read command as i have been doing? If it is possible, then it should be much faster when accessing a binary file from the network. (I have programmed something similar in Delphi before and that resulted in the desired speed up).
Many Thanks,
Andrew
My program works as intended. If I read from my local hard drive it reads very quickly. If I read from the network it is much much slower. I presume this is becasue a request needs to be made everytime I read a bit more data (which I do a lot, so it really is a very big performance hit)
Is it possible to read the entire binary file into memory first, and then access the data using the read command as i have been doing? If it is possible, then it should be much faster when accessing a binary file from the network. (I have programmed something similar in Delphi before and that resulted in the desired speed up).
Many Thanks,
Andrew
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no built-in support for memory files using Fortran I/O. You could read the file into memory as a large array and then write your own routines to access it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the information. I am now reading the file into a large character array and using the transfer function to convert between data of different types. This seems to work well.
Andrew
Andrew
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page