This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47694] New: Fortran read from named pipe fails to read all available data
- From: "David.Duffy at qimr dot edu.au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Feb 2011 06:50:04 +0000
- Subject: [Bug fortran/47694] New: Fortran read from named pipe fails to read all available data
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47694
Summary: Fortran read from named pipe fails to read all
available data
Product: gcc
Version: fortran-dev
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: David.Duffy@qimr.edu.au
I am mucking around with named pipes and read().
program testpipe
integer :: ios, n
character (len=1024) :: lin
open(7, file='tmpfifo')
n=0
do
read(7,'(a)', iostat=ios) lin
if (ios /= 0) exit
n=n+1
write(*,*) n, trim(lin)
end do
end program testpipe
Using gfortran (4.6.0 20110209), this stops before reading all data in the pipe
unless it is further topped up from the other end ;) As written, no such
problem with sunf95, g95, openf95 (runs until pipe emptied, then waits for
more). I presume it is a buffering problem somewhere.
Linux tinonee 2.6.32-27-generic #49-Ubuntu SMP Wed Dec 1 23:52:12 UTC 2010 i686
GNU/Linux
Cheers, David Duffy.