Mail Archives: djgpp/2009/04/04/22:17:41
> From: "Rod Pemberton" <do_not_have AT nohavenot DOT cmm>
> Date: Sat, 4 Apr 2009 19:35:52 -0400
>
> "Eli Zaretskii" <eliz AT gnu DOT org> wrote in message
> news:83bprccygw DOT fsf AT gnu DOT org...
> > > freopen() is supposed to implement all functionality of fopen(), which
> > > includes opening the redirected-to-file as binary.
> >
> > And it does, as long as you know the name of that file.
> >
>
> Then, what is DJGPP's filename to use for stdout as the first parameter of
> freopen()?
There is none, sorry.
> After looking at the spec., I'm asking how to go about using freopen() to do
> what is mentioned in ISO C 7.19.5.4 sub 3:
>
> "If filename is a NULL pointer, the freopen function attempts to change the
> mode of the stream to that specified by mode, as if the name of the file
> currently associated with the stream had been used. It is
> implementation-defined which changes of mode are permitted (if any), and
> under what circumstances."
This requirement is new with C99, it wasn't there in C89. DJGPP does
not fully support C99 yet, not even with (the unreleased) v2.04.
Patches are welcome, of course.
> How do I change the mode of stdout to binary, just as in the setmode call,
> by using freopen()?... NULL doesn't work. Is this functionality
> implemented?
No. NULL is invalid value for that argument, as C89 says, and DJGPP's
implementation fails when you do that.
- Raw text -