- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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
링크가 복사됨
2 응답
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
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.