Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ecsvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxt!houxm!whuxl!whuxlm!akgua!mcnc!ecsvax!hes From: hes@ecsvax.UUCP (Henry Schaffer) Newsgroups: net.micro.pc Subject: Appending to files. (pc-dos, ms-dos) Message-ID: <900@ecsvax.UUCP> Date: Thu, 12-Dec-85 20:59:24 EST Article-I.D.: ecsvax.900 Posted: Thu Dec 12 20:59:24 1985 Date-Received: Sat, 14-Dec-85 08:10:14 EST Distribution: net Organization: NC State Univ. Lines: 45 <>In unix one can redirect output to a file using > or redirect output to append to an existing file using >> . E.g., assuming that file "test" has some text in it: cat test > test2 cat test >> test2 produces two sequential copies of the test file in the test2 file. This can be verified by looking at test2, e.g., by cat test2. So I tried to do the same thing in pc-dos 2.10. (I'm guessing that the same thing will happen in ms-dos - correct me if I'm wrong.) type test > test2 type test >> test2 test2 ends up the correct size (in the dir listing), but type test2 only gives *one* copy of test. A quick list using debug shows that appending leaves the end-of-file-marker (^Z, hex 1A) in place and appends after it. So "type" stops at the first EOF and doesn't ever show the second copy of "test". The manual (Chap. 1, p. 6) simply says that the >> "Causes filename to be opened (created if necessary) and positions the write pointer at the end of the file so that all output is appended to the file." It is possible to append files, omitting the intermediate EOFs, by using the concatenate option of the COPY command. Thus one can always pipe to a new file, and then append that file as desired by using COPY. However that is an extra step - and it looks as if the >> is pretty much useless. Is there some way to use the >> in the same manner as in unix? Is this a peculiarity of pc-dos vs. ms-dos? Any sage words of wisdom would be welcome. --henry schaffer P.S. In case anyone is wondering why I care - I just got a copy of the ms-dos version of UNIX|STAT 5.1, which is a very good package of statistically oriented unix-style programs. I'm trying to learn how to use it effectively, and so I am using i/o redirection and pipes. After seeing how nicely these techniques do work (they do work even on a floppy diskette system, but much more nicely on a hard disk system) I've decided that most programs for ms-dos/pc-dos are really cp/m-style rather than unix-style.