- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]
program test_inquire
implicit none
integer :: i, ios, iunit, junit
open (newunit=iunit, file = 'new.dat', status = 'OLD', iostat = ios)
do i = 1,2
inquire (file = 'missing1.dat', number = junit, iostat = ios)
if (ios.eq.0) then
print *, i, 'ok'
elseif (ios .eq. 40) then
print *, i, 'Recursive i/o'
else
print *, i, "ios = ", ios
endif
enddo
end program test_inquire
[/fortran]
The second time round, this seems to catch a recursive i/o error. gfortran runs without error.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried that with XE 14.0.1.139 [IA-32] and get the same result.
whilst the example of making the same enquiry twice makes no sense, the result is still wrong IMO also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[fortran]
inquire (file = 'missing1.dat', number = junit1, iostat = ios)
inquire (file = 'missing2.dat', number = junit2, iostat = ios)
inquire (file = 'missing1.dat', number = junit3, iostat = ios)
[/fortran]
Gives ios=0 40 and 40 which is even more wrong!
Compiler XE 13.1.3.198 [IA-32] gives the same results
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for reporting this error. FWIW, the case behaves correctly under Linux but incorrectly on Windows as was noted. I forwarded it to Development and will post updated status as I learn it.
(Internal tracking id: DPD200250673)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page