Xref: utzoo comp.lang.pascal:4867 comp.os.msdos.programmer:2410 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!mit-eddie!uw-beaver!zephyr.ens.tek.com!vice!bobb From: bobb@vice.ICO.TEK.COM (Bob Beauchaine) Newsgroups: comp.lang.pascal,comp.os.msdos.programmer Subject: Re: Statusof a msdos file after dos error Message-ID: <6520@vice.ICO.TEK.COM> Date: 14 Dec 90 22:37:56 GMT References: <2350@bnlux0.bnl.gov> <6032@yang.earlham.edu> Followup-To: comp.lang.pascal Organization: Tektronix Inc., Beaverton, Or. Lines: 23 In article <6032@yang.earlham.edu> peters@yang.earlham.edu writes: > >The answer depends on whether you opened the file with reset or rewrite. >Verify this by opening a file with rewrite, sending >some text to the file with write/ln, and watching the light on the disk drive; >it will not glow until the close command is processed. > Close, but not quite true. There are three cases that will flush a text file in Turbo Pascal: 1. As you stated, when the file is closed. 2. If you call the flush(var f: text) procedure 3. When the internal file buffer fills, which happens every 128 bytes if you have not declared your own (larger) text file buffer. Any of the above three actions will send all pending data to the file. Note that this does *not* guarantee that the operating system will know about the data; the file size information and allocation chain in the FAT are not updated until the file is closed. Bob Beauchaine bobb@vice.ICO.TEK.COM