Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site asgb.UUCP Path: utzoo!linus!decvax!ittvax!dcdwest!sdcsvax!bmcg!asgb!gupta From: gupta@asgb.UUCP Newsgroups: net.bugs.usg Subject: Re: Bug in USG 5.2 stdio package. Message-ID: <564@asgb.UUCP> Date: Thu, 1-Nov-84 10:59:23 EST Article-I.D.: asgb.564 Posted: Thu Nov 1 10:59:23 1984 Date-Received: Sat, 3-Nov-84 05:19:02 EST References: <556@asgb.UUCP> <258@wlbr.UUCP> Organization: Burroughs Corporation, Boulder Colo. Lines: 27 > usually requires an fseek() when switching between read <--> write > modes on a file opened in any of the "+" modes. This is to insure that the > buffer pointers are set up properly. > > Jim Macropol > {ihnp4,trwrb,scgvaxd,vortex}!wlbr!jm This is what the Programmer Reference Manual states: - FOPEN(3S) - . - . - . - - When a file is opened for update, both input and output may - be done on the resulting stream. However, output may not be - directly followed by input without an intervening fseek or - rewind, and input may not be directly followed by output - without an intervening fseek, rewind,[1m or an input operation - which encounters end-of-file.[0m Thus, after an input operation that encounters end-of-file, the printf should work. Also, the printf doesn't work even if an fseek is added! Once you start reading the file, you just cannot write it using the printf!! Yogesh Gupta {sdcrdcf, sdcsvax}!bmcg!asgb!gupta