This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, libfortran] PR32784 CONIN$, CONOUT$, and CONERR$ for Cygwin and mingw


On Sun, Jun 14, 2009 at 1:30 PM, Jerry DeLisle<jvdelisle@verizon.net> wrote:
> Jerry DeLisle wrote:
>>
>> The attached patch provides mapping the special file names to standard IO.
>> ?This is an extension requested quite a ways back.
>>
>> Applied and tested / regression tested on Cygwin running on WinNT
>> workstation. I do not have a working mingw set-up and would much appreciate
>> someone building and testing for that system.
>>
>> OK for trunk if so tested and passes?
>>
> Here is a simple test case i have used. ?Redirection on the output apears to
> work as well.
>
> ? ? ?character(25) :: astring
> ? ? ?open(unit=29,file='CONOUT$')
> ? ? ?write(29,100)
> 100 ? format('Hello, world!')
> ? ? ?open(unit=39,file='CONERR$')
> ? ? ?write(39,200)
> 200 ? format('This goes to conerr$!')
> ? ? ?open(unit=49,file='CONIN$')
> ? ? ?read(49,'(a)') astring
> ? ? ?write(29,'(a)') astring
> ? ? ?end
>

The testcase fails on mingw32. This is the output, when run from DOS cmd:

Hello, world!
This goes to conerr$!

The program then hangs until I press <Enter> key. The last output to
CONOUT is lost.


Similar problems occur if I redirect stdout or stderr output.

If redirect stdin through a pipe (eg when testing the program from a
text editor) I get:
Hello, world!
This goes to conerr$!
At line 9 of file conout.f90 (unit = 49, file = 'CONIN$')
Fortran runtime error: Bad file descriptor

Danny

> Regards,
>
> Jerry
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]