FIX: QuickBasic CopyFile Routine May Return Bad Error Code (47752)



The information in this article applies to:

  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0
  • Microsoft QuickBASIC Compiler for the Apple Macintosh 1.0a

This article was previously published under Q47752

SYMPTOMS

The CopyFile routine (an MBLC) supplied with Microsoft QuickBasic versions 1.0 and 1.0a for the Macintosh returns incorrect error codes in some cases.

Microsoft has confirmed this to be a bug in QuickBasic versions 1.0 and 1.0a. This problem is corrected in QuickBasic version 1.0b.

MORE INFORMATION

The following is a list of CopyFile error messages that Microsoft has confirmed to be incorrect:
   Incorrect CopyFile Error     Correct Error
   ------------------------     -------------

   57 Device I/O error          61 Disk Full
   53 File not found            70 Disk write-protected
    5 Invalid function call     74 Unknown disk name
				
Any CopyFile operation that should produce one of these correct errors instead displays the corresponding incorrect error message.

How to Use CopyFile

The syntax of the CopyFile command is the following:
   CopyFile "file", "destination file"
				
CopyFile is useful because it copies both the data and resource forks of a file to a destination file. CopyFile is documented only in the README file on the QuickBasic 1.0 release disk (not in the manual).

If an error occurs during CopyFile, the file that was being created stays open. If the disk containing the CopyFile's destination file is ejected after an error occurs, the disk icon is still displayed. This is because the system keeps track of the open file. To remove the disk icon from the screen, run another application or reboot. When that application is finished running, the disk icon is gone.

CopyFile copies files correctly if an error is not encountered. If you check for the possible errors before you use CopyFile, you guarantee CopyFile's success. Those errors are listed on page 559 of "Microsoft QuickBasic for Macintosh : Language Reference."

Modification Type:MajorLast Reviewed:10/20/2003
Keywords:kbbug kbfix KB47752