Reply to Message Icon Go to Main Page Icon

Dos copy

Original Message
Name: Mechanix2Go
Date: March 23, 2005 at 08:44:49 Pacific
Subject: Dos copy
OS: w2k
CPU/Ram: PIII 933 / 256
Comment:

Well...

Somebody's got to post something before this forum falls over dead.

Way back when AFAIK, DOS would do an ASCII COPY or binary COPY depending on... what?

The file extension?

Recent versions [9x] seem to do a binary COPY by default.

Here's the question:

As of what version did DOS COPY do a binary copy by default?


M2

If at first you don't succeed, you're about average.



Report Offensive Message For Removal


Response Number 1
Name: Nigel Spike
Date: March 23, 2005 at 09:16:38 Pacific
Subject: Dos copy
Reply: (edit)

ASCII copying was default and for binary you have (had?) to use /B after the source file. To force ASCII copying you could use the switch /A.

ASCII copying meant that the copy command read the file to the EOF mark (^Z). And ended writing the destination file with an EOF.

Binary copying read the file according to the size reported in the directory, and wrote the destination file the same size without an EOF.

I never copied a binary file myself, so I can't say when the /B became redundant, but I'm certain it was neccessay in the versions 2 and 3.

Let's see who knows better.

Nigel



Report Offensive Follow Up For Removal

Response Number 2
Name: wizard-fred
Date: March 23, 2005 at 16:56:56 Pacific
Subject: Dos copy
Reply: (edit)

I don't know when it changed, never noticed.

The only time I used the /b was to (re)print images to a color printer. Printing tied up the main computer too long. So the printer data stream was saved to a file and transfered to a slower computer.


Report Offensive Follow Up For Removal

Response Number 3
Name: rogerashley
Date: March 24, 2005 at 00:26:35 Pacific
Subject: Dos copy
Reply: (edit)

http://www.computerhope.com/copyhlp.htm


FTP supports two file transfer types, ASCII and binary image.

ASCII should be used when transferring text files. In ASCII mode, character conversions to and from the network standard character set are performed. For example, end-of-line characters are converted as necessary, based on the target operating system.

Binary should be used when transferring executable files. In binary mode, the file is moved byte-by-byte.


Report Offensive Follow Up For Removal

Response Number 4
Name: wizard-fred
Date: March 24, 2005 at 02:01:41 Pacific
Subject: Dos copy
Reply: (edit)

Making binary default guarantees the file be copied. It doesn't matter what data is included after the EOF mark. An ASCII application will stop reading when it hits the EOF. A binary app should know how much to use.


Report Offensive Follow Up For Removal

Response Number 5
Name: Nigel Spike
Date: March 24, 2005 at 09:18:07 Pacific
Subject: Dos copy
Reply: (edit)

I was just about to disagree with wizard-fred regarding an "ASCII application will stop reading when it hits the EOF", then I tested it. And proved fred to be right!

The /A before or after the source file stops the reading at the first EOF.

The test was done copying command.com which contains many EOF. The first already after 172 bytes.

Nigel


Report Offensive Follow Up For Removal


Response Number 6
Name: Iowa
Date: March 24, 2005 at 09:31:30 Pacific
Subject: Dos copy
Reply: (edit)


When the DOS "COPY" command is used to concatenate files (e.g., COPY file1+file2), it treats the files as ASCII by default, and requires the /B switch to treat them as binary.

I don't believe any such distinction was ever made when COPY is used to simply copy a file to another location. Whether ASCII or binary, the entire file is copied.



Report Offensive Follow Up For Removal

Response Number 7
Name: Nigel Spike
Date: March 24, 2005 at 09:48:56 Pacific
Subject: Dos copy
Reply: (edit)

That's probably because you normally concatenate pure text files, that only has the EOF at the end. IMHO


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Dos copy

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software