[Bug libfortran/32784] [win32] Using 'con' as assigned file generates Fortran runtime error: File 'con' does not exist
dannysmith at users dot sourceforge dot net
gcc-bugzilla@gcc.gnu.org
Tue Jul 17 08:44:00 GMT 2007
------- 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
More information about the Gcc-bugs
mailing list