Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!zephyr.ens.tek.com!tekcrl!tekgvs!toma From: toma@tekgvs.LABS.TEK.COM (Tom Almy) Newsgroups: comp.sys.ibm.pc Subject: Re: append " >> " is not working, why? Message-ID: <5940@tekgvs.LABS.TEK.COM> Date: 15 Sep 89 14:47:39 GMT References: <4734@shlump.nac.dec.com> <2553@pur-phy> Reply-To: toma@tekgvs.LABS.TEK.COM (Tom Almy) Organization: Tektronix, Inc., Beaverton, OR. Lines: 28 In article <2553@pur-phy> qz@maxwell.physics.purdue.edu.UUCP (Qin Zhao) writes: > Hi, I recently got some problem when I tried to concatenate two files. >What I have done is following: > There is tow file: file1 and file2 ( I got from somebody else ). > I gave command: > type file2 >> file1 > in order to put file2 at the end of file1. And then I used "dir" to check >the size of file1, it was increased by the size of file2. >However, when I tried to read the contents of file1, I could only see the >original part of file1. I had used several editors, and "type" commands. >But when I rewrote file1 using the editor, the size of file1 drops to the >original size of file1. While DOS is perfectly capable of knowing file sizes, DOS was originally designed as a copy of CP/M, which had fixed length (128 byte) blocks. In CP/M you would mark the end of an ASCII file with a control-Z character. Because of this, most DOS programs that handle text treat a control-Z character as an end-of-file marker. File1 was undoubtedly created by a program that inserts control-Zs at the end of file (typical for programs that trace their roots back to CP/M). So when you append file2 to the end of file1, file1 has a control-Z character at the end of its original data. The editors and type commands you used simply stopped at the control-Z. Tom Almy toma@tekgvs.labs.tek.com Standard Disclaimers Apply