From owner-freebsd-bugs Wed Mar 5 04:37:07 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id EAA14286 for bugs-outgoing; Wed, 5 Mar 1997 04:37:07 -0800 (PST) Received: from os.inf.tu-dresden.de (os.inf.tu-dresden.de [141.76.1.46]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id EAA14272 for ; Wed, 5 Mar 1997 04:37:01 -0800 (PST) Received: from sax.sax.de (sax.sax.de [193.175.26.33]) by os.inf.tu-dresden.de (8.8.5/8.8.5) with ESMTP id NAA27357 for ; Wed, 5 Mar 1997 13:20:56 +0100 Received: (from uucp@localhost) by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id IAA18921 for bugs@freebsd.org; Wed, 5 Mar 1997 08:50:47 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.8.5/8.8.5) id IAA15161; Wed, 5 Mar 1997 08:40:49 +0100 (MET) Message-ID: Date: Wed, 5 Mar 1997 08:40:49 +0100 From: j@uriah.heep.sax.de (J Wunsch) To: bugs@FreeBSD.ORG Subject: Re: bin/2870: fetch won't restart http transfers References: <9703041506.AA26430@halloran-eldar.lcs.mit.edu> X-Mailer: Mutt 0.55-PL10 Mime-Version: 1.0 X-Phone: +49-351-2012 669 X-PGP-Fingerprint: DC 47 E6 E4 FF A6 E9 8F 93 21 E0 7D F9 12 D6 4E Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: ; from Marc Slemko on Mar 4, 1997 09:23:13 -0700 Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk As Marc Slemko wrote: > > This is incorrect. The correct code would be: > > > > if (to_stdout) > > local = fopen("/dev/stdout", restarting ? "a" : "w"); > > else > > local = fopen(fs->fs_outputfile, restarting ? "a" : "w"); > > I actually thought about it, but: > > 1. how are we going to append to stdout and what meaning > does that have? It will append to it. :-) OTOH, it seems opening it for writing does yield the exact same behaviour in FreeBSD. You can try this with something like: j@uriah 281% cat foo.c #include int main(void) { FILE *f; f = fopen("/dev/stdout", "w"); fprintf(f, "Hello, world!\n"); return 0; } j@uriah 282% cc foo.c j@uriah 283% ( echo "Goodbye world" ; ./a.out ) > foobar j@uriah 284% cat foobar Goodbye world Hello, world! The result is identical, regardless of whether "w" or "a" is used. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)