This is the mail archive of the gcc-bugs@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]

[Bug libfortran/32784] [win32] Using 'con' as assigned file generates Fortran runtime error: File 'con' does not exist



------- Comment #6 from dannysmith at users dot sourceforge dot net  2007-07-17 08:43 -------
(In reply to comment #4)
> What name should I change 'con' to so that the write statement writes to the
> console? 

I think it should be CONOUT$ (ie you had it right the first time).
The following works with g77 (and the old Intel Fortran ivf compiler)

      open(unit=29,file='CONOUT$')
      write(29,100)
100   format('1Hello, world!')
      end 

The following works in C

#include <fcntl.h>
#include <sys/stat.h>
#include <stdlib.h>

int main()
{
 int fd= _open ("CONOUT$", _O_RDWR));
  if (fd >= 0)
   _write (fd, "Hello world", sizeof ("Hello world"));   
 return 0;
}


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32784


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