fopen() and CON

Andre Oliveira da Costa costa@cade.com.br
Fri Dec 10 12:26:00 GMT 1999


Hi,

I'm writing a program in which I have to open (literally) thousands of
files, each with its own name (there are no duplicated names). One of them,
to my deepest sorrow, is named CON.html, which leads to this situation:
fopen("CON.html", "w") returns a valid (not NULL) pointer, _different from
stdout or stderr_. However, every output I redirect to this file (with
fprintf()) is actually redirected to the terminal. It took me a _long_ time
to remember that, under MS-DOS, CON is associated to the terminal. Now,
things are clearer, but still some doubts remain:

* should the CON device had been opened if I asked for CON.html?
* is there any way to avoid this? (I mean, what I really want is to have a
text file named CON.html)

I'm using B20.1 with snapshot 19991122 on top of it, and gcc-2.95.2.

TIA,

Costa
--
André Oliveira da Costa
(costa@cade.com.br)

BTW: Before someone asks: each file is closed before the next is opened, so
I don't run into any limit of opened files.


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list