- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I have a question as follows.
I got an error message from my program.
fortl:severe(24): end-of-file during read, unit1, file cpppfile-name.log
Image PC...
DFORRTD.DLL
My program sorce ocde.
open(1,file=cpppfile-name.log)
read(1,'(i3)',err=11)tmpst
close(1)
11 goto 50
...
50 return
file-name.log size is 0 byte. Therefore I quess read statement would faild.
How should I fix this error? Please give me hands, please.
Link Copied
5 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Just try a do while loop... And treat the filename as a string!
open(unit=1,file='cpppfile-name.log')
do while (.not. EOF(1))
read (1,'(i3)') tmpst
end do
close(1)
HTH, Markus
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is your path correct - i.e do you have a folder called c containing a subfolder called ppp at the level you are running the program from - or did you mean c:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ERR= label is not triggered when an end-of-file is reached; that's as it should be – you need an END= label instead. If you want to treat both EOF and other errors in the same way, you can specify both, or use IOSTAT=.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
This code should force any read error to jump to line 1100.
read (ZMESG,*, err=1100, IOSTAT=IERR) XX, YY
if (IERR .NE. 0) goto 1100
Hope this works,
Lars Petter
Message Edited by lpe@scandpowerpt.com on 03-24-200607:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I appreciate all of answering my issue.
I want to say thank you very much for suggestions.
All suggestions give me oppotunity to get important experiments.
Thank you again.

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