BUG: CopyFile Fails with Read-Only Files

Last reviewed: January 28, 1998
Article ID: Q145935

The information in this article applies to:
  • Microsoft Win32 Software Development Kit on the following platform:

        - Microsoft Windows 95
    

SYMPTOMS

The CopyFile function fails and GetLastError returns ERROR_ACCESS_DENIED when you try to copy a read-only file to a core SMB server (such as a LAN Manager for UNIX server) or to a Netware server when the client computer uses real-mode network drivers. The destination file is created as a read-only file and is zero in length.

CAUSE

This error message occurs because there is a mismatch between the way that the Windows 95 redirector accesses files and the way that these servers expect this access.

RESOLUTION

Remove the read-only attribute before calling the CopyFile function to allow the file to be copied correctly. After the copy is complete, then the read-only attribute can be restored.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords          : BseFileio
Version           : Win95
Platform          : Win95
Issue type        : kbbug


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


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.

Last reviewed: January 28, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.