This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/32784] [win32] Using 'con' as assigned file generates Fortran runtime error: File 'con' does not exist
- From: "dannysmith at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2007 08:43:58 -0000
- Subject: [Bug libfortran/32784] [win32] Using 'con' as assigned file generates Fortran runtime error: File 'con' does not exist
- References: <bug-32784-14861@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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