Path: utzoo!attcan!uunet!husc6!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: What is wrong? Message-ID: <9492@smoke.BRL.MIL> Date: 24 Jan 89 21:40:10 GMT References: <2051@ndsuvax.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 11 In article <2051@ndsuvax.UUCP> numork@ndsuvax.UUCP (James Mork) writes: - j=putc(i,fi); - a simple program like this, the file gets truncated after 25 or - 26 bytes... After 25 when I read the file back in, I just - get EOF (-1). What is wrong? Sounds to me like a ^Z in a text stream is taken as an EOF indicator. I know CP/M had this misfeature; maybe PC-DOS does too. You probably should have been using binary streams instead. I.e. fopen with mode "wb" or "rb".