Article View: comp.os.msdos.programmer
Article #3912Re: minor problem with COPY command
From: Steve Harrold
Date: Thu, 13 Dec 1990 19:19
Date: Thu, 13 Dec 1990 19:19
47 lines
2003 bytes
2003 bytes
Re: Problems with COPY command
COPY commands of the form:
COPY file*.* targetfilename
COPY file1+file2+file3 targetfilename
combine (concatenate) files into one target file. Note carefully that
"targetfilename" is a filename NOT a directory name.
To quote from my HP Vectra MSDOS User's Reference,
"When COPY is used to copy a file, the source and target files
are treated as binary if no option is specified. When COPY
is used to combine files, the files are treated as ASCII if
no option is specified."
In your examples,
COPY JUNK.* A: is a file copy, assume binary
COPY JUNK.* TEMPFILE.* is a file copy, assume binary
COPY JUNK.COM TEMPFILE is a file copy, assume binary
COPY JUNK.* TEMPFILE is a file combine, assume ascii
A binary copy operation replicates the original file exactly, using the
directory filesize information. This is the default and corresponds to
the the most common way that people use the COPY command.
An ascii copy operation replicates each source file until the first
end-of-file marker (ctrl-Z) is encountered with the remainder of the file
being ignored. A ctrl-Z is placed at the end of the target file.
In short, the behaviour you've observed is CORRECT. Perhaps not intuitive,
but correct neverthless.
If you want to do what you've intended to do, execute:
COPY /B JUNK.* TEMPFILE
--
---------------------
Steve Harrold swh@hpda.hp.com
...hplabs!hpda!swh
HPG200/11
(408) 447-5580
---------------------
Technical Details
Message-ID:
<51040002@hpcupt1.cup.hp.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!hplabs!hpda!hpcupt1!swhReferences:
<31600012@hpcvra.cv.hp.com.CV.HP.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!hplabs!hpda!hpcupt1!swh From: swh@hpcupt1.cup.hp.com (Steve Harrold) Newsgroups: comp.os.msdos.programmer Subject: Re: minor problem with COPY command Message-ID: <51040002@hpcupt1.cup.hp.com> Date: 13 Dec 90 19:19:05 GMT References: <31600012@hpcvra.cv.hp.com.CV.HP.COM> Organization: Hewlett Packard, Cupertino Lines: 47