Mail Archives: djgpp/2012/05/05/02:15:28

X-Authentication-Warning: mail set sender to djgpp-bounces using -f
From: Georg <dosusb AT googlemail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: freopen
Date: Fri, 4 May 2012 23:01:07 -0700 (PDT)
Lines: 24
Message-ID: <>
References: <4182049f-12cf-4935-892b-daeaac0f3fd8 AT v2g2000vbx DOT googlegroups DOT com> <a0j2npFlg6U1 AT mid DOT dfncis DOT de>
Mime-Version: 1.0
X-Trace: 1336197782 27832 (5 May 2012 06:03:02 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sat, 5 May 2012 06:03:02 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info:; posting-host=; posting-account=v5xbdQoAAAAOGc9Ccc-kLZyobvPlN3Qr
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:
Gecko/20091016 Firefox/3.5.4,gzip(gfe)
Bytes: 2033
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
X-MIME-Autoconverted: from quoted-printable to 8bit by id q456F4LG004482
Reply-To: djgpp AT delorie DOT com

On May 5, 12:15 am, Hans-Bernhard Bröker <HBBroe DOT  DOT  DOT  AT t-online DOT de>
> On 04.05.2012 21:41, Georg wrote:
> > All works fine, just the message "here4" does not appear on the
> > screen. How do I properly close the file "stdout.dat"?
> You already did.  Read the description of freopen() again: what does it
> say happens to the file you pass as an argument to freopen()?

Then I do not understand the description:

"FILE *freopen(const char *filename, const char *mode, FILE *file);


This function closes file if it was open, then opens a new file like
fopen(filename, mode) (see section fopen) but it reuses file."

I read this description that the third parameter of freopen is closed,
in my example it is stdout. The resulting handle is associated with
stdout.dat and I do not see that this gets closed.


- Raw text -

  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019