Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!columbia!rutgers!sri-spam!nike!ucbcad!ucbvax!decvax!tektronix!uw-beaver!bnfb From: bnfb@uw-beaver.UUCP Newsgroups: net.unix Subject: Bug in 4.3/4.2 stdio with "w+"? Message-ID: <1871@uw-beaver> Date: Fri, 10-Oct-86 15:56:29 EDT Article-I.D.: uw-beave.1871 Posted: Fri Oct 10 15:56:29 1986 Date-Received: Sat, 11-Oct-86 21:42:25 EDT Organization: U of Washington Computer Science Lines: 28 This program worked under 4.2bsd but not under 4.3bsd. If you change the "w+" to "w", it works. Or if you use "a" instead of "a+". The program: #include main() { FILE* pF; long l; pF = fopen("TEMP","w+"); fputs( "AAAAA\n", pF ); l = ftell( pF ); fputs( "BBBBB\n", pF ); fseek( pF, l, 0 ); fputs( "CC", pF ); fclose( pF ); } Under 4.2 it produces: Under 4.3 it produces: AAAAA AAAAA CCBBB BBBBB Is this a real bug or am I just lost? Bjorn