DOCUMENT:Q107408  19-NOV-1993  [B_WFOXPRO]
TITLE   :ERR: "Lpt1 Already Exists, Overwrite It?" Copying File to LPT
PRODUCT :FoxPro For Windows
PROD/VER:2.50 2.50a 2.50b | 1.02 2.00 2.50 2.50a 2.50b
OPER/SYS:WINDOWS          | MS-DOS
KEYWORDS:

--------------------------------------------------------------------
The information in this article applies to:

 - Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
 - Microsoft FoxPro for MS-DOS, versions 1.02, 2.0, 2.5, 2.5a, and
   2.5b 
--------------------------------------------------------------------

SUMMARY
=======

When you are using the COPY FILE command to copy a file to a printer
port, the following message is generated when SAFETY is set ON:

   <path name>lpt1 already exists, overwrite it?

MORE INFORMATION
================

When a command similar to the following is issued

   COPY FILE test.txt TO lpt1

FoxPro is actually copying the TEST.TXT file to a file called LPT1.
However, MS-DOS interprets the request to open the file LPT1 as a
request to send data to the printer port.

Because FoxPro is copying to a file, the SET SAFETY command recognizes
that the "file" LPT1 already exists (as an MS-DOS device), and
verifies that the user wants to overwrite it.

To prevent this message, issue code similar to the following to set
SAFETY OFF before copying the file to the port, then set SAFETY ON
again immediately:

   SET SAFETY OFF
   COPY FILE <filename> TO <printer port name>
   SET SAFETY ON

NOTE: This error might not occur when you are copying a file to a
network printer port.

Additional reference words: 1.02 2.00 2.50 2.50a 2.50b lpt2 lpt3 com1
com2 com3 com3 lpt1.dos lpt2.dos lpt3.dos com1.dos com2.dos com3.dos
com4.dos errmsg err msg

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS
PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.  MICROSOFT DISCLAIMS
ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  IN NO
EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR
ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL,
CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF
MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.  SOME STATES DO NOT ALLOW THE EXCLUSION
OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES
SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1993.