Reading Data from the Communications Port to a File (60716)



The information in this article applies to:

  • Microsoft MS-DOS operating system 3.1
  • Microsoft MS-DOS operating system 3.2
  • Microsoft MS-DOS operating system 3.21
  • Microsoft MS-DOS operating system 3.3
  • Microsoft MS-DOS operating system 3.3a
  • Microsoft MS-DOS operating system 4.0
  • Microsoft MS-DOS operating system 4.01
  • Microsoft MS-DOS operating system 5.0

This article was previously published under Q60716

SUMMARY

Using Microsoft MS-DOS Packaged Product Versions 3.x, 4.x, and 5.0, you can capture data from a communications port to a file by using any of the following commands:
   COPY COMn: /A <file>
   COPY COMn: <file> /A
   COPY COMn: <file>
				
An end-of-file (EOF) character (CTRL+Z or ASCII 26) is used to mark the end of the file. The file will have a terminating EOF character only if you use the /A switch of the COPY command.

If you use the /B switch for the COPY command, the message "Cannot do binary reads from a device" is displayed, and COPY terminates.

While the file is being transmitted, spurious characters may be captured before the start of the data stream, due to the asynchronous nature of the COPY command. It is your responsibility to ensure that the data is checked for usability.

Modification Type:MajorLast Reviewed:11/26/2003
Keywords:KB60716