Article View: comp.sys.ibm.pc.misc
Article #3472Re: Turbo C, fopen(), fprint() and ^Z - The solution.
From: Michael Phillips
Date: Fri, 28 Sep 1990 22:19
Date: Fri, 28 Sep 1990 22:19
21 lines
1393 bytes
1393 bytes
brand@janus.Berkeley.EDU (Graham Brand) writes:
>...
>any line of text that was added to the end of the file. The only file
>operations that were done in the program were fopen() and fprintf()?
>Where was the ^Z coming from and which of the changes, fseek(.,-1L,.) or
>fopen(.,"b"), cured it?
>Thanks for all your help,
>-Graham
Graham, Absolutely, positively, it was the fopen(.,"b") that cured your ^Z
problem. Since ^Z is the "end-of-file" marker for _TEXT_ files, anytime a
file is opened as _text_ ("t", the usual default), and the file is updated
in some way, it should have a ^Z appended to the end. Now I think that
the ^Z is basically useless, but it is the way DOS defines things so I live
with it.
Michael
*-----------------------------------------------------------------------*
D&B Software Atlnata, GA - "Constants aren't and Variables don't"
Technical Details
Message-ID:
<1393@msa3b.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!emory!wa4mei!nanovx!msa3b!mgphlReferences:
<38823@ucbvax.BERKELEY.EDU>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!emory!wa4mei!nanovx!msa3b!mgphl From: mgphl@msa3b.UUCP (Michael Phillips) Newsgroups: comp.sys.ibm.pc.misc,comp.sys.ibm.pc.hardware,comp.lang.c Subject: Re: Turbo C, fopen(), fprint() and ^Z - The solution. Message-ID: <1393@msa3b.UUCP> Date: 28 Sep 90 22:19:40 GMT References: <38823@ucbvax.BERKELEY.EDU> Followup-To: comp.sys.ibm.pc.misc Organization: Management Science America, Inc., Atlanta, GA Lines: 21