Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!rutgers!husc6!wjh12!maynard!campbell From: campbell@maynard.UUCP Newsgroups: comp.sys.ibm.pc Subject: Re: Truncating MS-DOS files Message-ID: <834@maynard.BSW.COM> Date: Thu, 19-Feb-87 01:01:39 EST Article-I.D.: maynard.834 Posted: Thu Feb 19 01:01:39 1987 Date-Received: Fri, 20-Feb-87 07:26:06 EST References: <1987Feb15.123004.21019@gpu.utcs.toronto.edu> <2596@well.UUCP> <3105@gitpyr.gatech.EDU> Reply-To: campbell@maynard.UUCP (Larry Campbell) Organization: The Boston Software Works, Inc. Lines: 27 Summary: RTFM In article <3105@gitpyr.gatech.EDU> roy@gitpyr.gatech.EDU (Roy Mongiovi) writes: >Well, quite some time ago I also heard that CX=0 on a write would truncate >the file. When I became curious about it recently, I looked in the IBM >PC-DOS Technical reference manuals for DOS 2.1 and 3.0 (the only ones I >had available). I looked in the function documentation distributed to >OEM's by Microsoft for MS-DOS 2.0. I also looked in the book >"Advanced MS-DOS" by Ray Duncan. > >None of these sources mentioned a thing about CX=0 being a legal value or >not, much less saying that it allows you to truncate a file. My IBM "DOS Technical Reference", publication no. 6138536 (for DOS 3.10) documents this behavior, both for function 0x28 (random block write, pg. 6-85) and function 0x40 (write to a file or device, pg. 6-126). Also, my Microsoft "MS-DOS Operating System Programmer's Reference Manual", document no. 8411-200-00 (for DOS 2.01) documents this behavior, both for function 0x28 (pg. 1-84) and function 0x40 (pg. 1-117). The latter document is copyright 1981 and 1983 by Microsoft, so this information has been available for at least four years. -- Larry Campbell The Boston Software Works, Inc. Internet: campbell@maynard.uucp 120 Fulton Street, Boston MA 02109 uucp: {alliant,wjh12}!maynard!campbell +1 617 367 6846 ARPA: campbell%maynard.uucp@harvisr.harvard.edu MCI: LCAMPBELL