- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello Steve,
I have recently upgraded my Intel compiler from DVF 6.6a to Intel Compiler 13 (Visual Fortran Compiler XE 13.1.3.198 [IA-32].
And I now have following problem:
This simple read statement keeps returning an IOSTAT = -1. Telling me that I am at the end of the file.
When I run the debugger I don’t have any problems and the IOSTAT returns correct 0.
Code:
open(handle,file=outfile,status='OLD', iostat = ios)
rewind(handle, iostat = ios1)
write(66,*) 'rewind status: ',ios1
read(handle,'(a256)', iostat = ios, err=920) XML_line
write(66,*) 'After read: ',ios
write(66,*) 'xml_line: ', xml_line
Is this a problem you have heard about before?
Thanks a lot for your help.
Best regards
Lane Hjelme
Johnson Controls Denmark
コピーされたリンク
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I would check to make sure you are opening the correct file. My guess is that you're opening an empty file.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hello Steve,
Thanks for your answer.
I am quite sure the file is not empty. I have a poller program that is polling a folder - I check if the files exist
and have a size. Then I move on with the READ Statement.
I am asking you because it is not the first time I have problems with READ after installing new compiler.
From my program I am calling an external program. I/O is done by writing/reading XML files.
I think it could be a timing problem since it works fine in the debugger.
I have tried several different compiler options but haven't been able to solve the problem.
Best regards Lane
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Are the files you are opening on a network drive, or are they on the machine that is running the program?
I suggest trying your READ on a file that is located in the same folder as the executable and see if
even that results in the problem you see.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Try a CALL SLEEPQQ(500) before the first read (requires USE IFPORT) if it is a timing problem.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thanks for all your answers.
app4619: And especially to you - a call to SLEEPQQ solved my problem.