From owner-cvs-all Sun Jan 26 4:19:49 2003 Delivered-To: cvs-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id 7ABA537B412; Sun, 26 Jan 2003 04:19:47 -0800 (PST) Date: Sun, 26 Jan 2003 04:19:47 -0800 From: Juli Mallett To: Hiten Pandya Cc: "Tim J. Robbins" , cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/stdio fopen.3 freopen.c Message-ID: <20030126041947.A67649@FreeBSD.org> References: <200301261001.h0QA1xpo065748@repoman.freebsd.org> <20030126121550.GA58214@unixdaemons.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030126121550.GA58214@unixdaemons.com>; from hiten@unixdaemons.com on Sun, Jan 26, 2003 at 07:15:50AM -0500 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , , X-Towel: Yes X-LiveJournal: flata, jmallett X-Negacore: Yes Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * De: Hiten Pandya [ Data: 2003-01-26 ] [ Subjecte: Re: cvs commit: src/lib/libc/stdio fopen.3 freopen.c ] > On Sun, Jan 26, 2003 at 02:01:59AM -0800, Tim J. Robbins wrote the words in effect of: > > tjr 2003/01/26 02:01:59 PST > > > > Modified files: > > lib/libc/stdio fopen.3 freopen.c > > Log: > > Initial implementation of the C99 feature whereby calling freopen() with > > a NULL filename argument allows a stream's mode to be changed. At the > > moment it just recycles the old file descriptor instead of storing the > > filename somewhere and using that to reopen the file, as the standard > > seems to require. Strictly conforming C99 applications probably can't > > tell the difference but POSIX ones can. > > > > PR: 46791 > > Is this like fmemopen()/open_memstream()? No, it's like changing the mode a FILE stream is opened as. So you can use freopen to go from being say "rb" to "w+", etc. The problems tjr points out relate to just using the fd, as opposed to doing what seems desired: actually reopen the stream in question, as opposed to just updating it. Or so I understand it. Thanx, juli. -- Juli Mallett AIM: BSDFlata -- IRC: juli on EFnet. OpenDarwin, Mono, FreeBSD Developer. ircd-hybrid Developer, EFnet addict. FreeBSD on MIPS-Anything on FreeBSD. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message