🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3924

Re: minor problem with COPY command

#3924
From: Ralf.Brown
Date: Thu, 13 Dec 1990 12:17
37 lines
2392 bytes
In article <31600012@hpcvra.cv.hp.com.CV.HP.COM>, everett@hpcvra.cv.hp.com.CV.HP.COM (Everett Kaser) wrote:
}OK, here's one for ya (and Microsoft).  Lets assume that you have a program
}called JUNK.COM in your current directory and it's 15385 bytes long (the
}number doesn't matter).  Now, do this:
}     COPY JUNK.* TEMPFILE
}You shouldn't have any other files in the current directory that match JUNK.*
}besides JUNK.COM.  The result of this copy will be a file called TEMPFILE
}with today's date and smaller than the original JUNK.COM (usually by a long
}ways).  What appears to be happening is that the COPY is being done as if
}JUNK.COM was an ASCII file, and as soon as an EOF character (26) is encountered
}the copy halts.  The following will work:
}    COPY JUNK.* A:
}    COPY JUNK.* TEMPFILE.*
}    COPY JUNK.COM TEMPFILE
}But NOT 
}    COPY JUNK.* TEMPFILE
}Seems like a bug to me.

Nope.  First, you can force a binary copy with the /B switch (before
JUNK.*). Second, you want the copy to be in ASCII mode if you are
concatenating text files which use the old ^Z end-of-file marker.  An
ASCII copy stops reading each source file when the ^Z is reached, then
appends a single ^Z to the destination file after the copy completes.
If it didn't act that way on concatenating files, you would have
embedded ^Zs which would either confuse many programs or cause them to
stop reading after the first file, thus effectively losing the rest of
the files which were concatenated.

In fact, the MSDOS 3.30 docs state:

   "When you are combining files, the default switch is always /a."

--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: 1:129/3.1
Disclaimer?    |   I was gratified to be able to answer promptly, and I did.
What's that?   |   I said I didn't know.  --Mark Twain
Technical Details
Message-ID: <27677f65@ralf>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!wuarchive!udel!rochester!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU
From: Ralf.Brown@B.GP.CS.CMU.EDU
Newsgroups: comp.os.msdos.programmer
Subject: Re: minor problem with COPY command
Message-ID: <27677f65@ralf>
Date: 13 Dec 90 12:17:25 GMT
Sender: ralf@b.gp.cs.cmu.edu
Organization: Carnegie Mellon University School of Computer Science
Lines: 37
In-Reply-To: <31600012@hpcvra.cv.hp.com.CV.HP.COM>