delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2012/05/05/02:15:28

X-Authentication-Warning: delorie.com: 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)
Organization: http://groups.google.com
Lines: 24
Message-ID: <3394f14f-8b8e-4b81-baa2-1f986b13d4eb@p21g2000vby.googlegroups.com>
References: <4182049f-12cf-4935-892b-daeaac0f3fd8 AT v2g2000vbx DOT googlegroups DOT com> <a0j2npFlg6U1 AT mid DOT dfncis DOT de>
NNTP-Posting-Host: 2.174.182.95
Mime-Version: 1.0
X-Trace: posting.google.com 1336197782 27832 127.0.0.1 (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: p21g2000vby.googlegroups.com; posting-host=2.174.182.95; posting-account=v5xbdQoAAAAOGc9Ccc-kLZyobvPlN3Qr
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.4)
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 delorie.com 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>
wrote:
> 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);

Description

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.

Georg

- Raw text -


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