PRB: MoveFile Fails to Move UNC Names When NETX Is Installed

Last reviewed: February 27, 1996
Article ID: Q147437
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with Microsoft Windows 95

NOTE: Some products mentioned in this article are manufactured by vendors independent of Microsoft; we make no warranty, implied or otherwise, regarding these products' performance or reliability.

SYMPTOMS

When the network client is the real-mode Netware NETX redirector for Netware 3.11, MoveFile() fails to rename files and directories when the source and destination names are specified in Universal Naming Convention (UNC) format. The return value of MoveFile() is FALSE, but GetLastError() reports an error code of NO_ERROR (0).

The following code demonstrates the problem:

   MoveFile ("\\\\testsrv\\testshare\\srcdir",
             "\\\\testsrv\\testshare\\destdir");

This problem does not occur with the NETX for Netware 3.12 and later or with protected-mode Netware clients.

CAUSE

NETX for Netware 3.11 does not support renaming files and directories using UNC names.

RESOLUTION

There are several possible workarounds for this problem:

  • Map a drive letter to the server and share. Then use this drive letter to do the rename. Use WNetAddConnection() or WNetAddConnection2() to map the drive letter.

    -or-

  • Copy the source directory (and all subdirectories) to the destination directory, and then delete the source directory. This operation will be slow if the source directory contains a lot of files and subdirectories.

    -or-

  • Upgrade to the protected-mode Netware client, or use VLM instead of NETX.

STATUS

This behavior is by design.

MORE INFORMATION

Although the bug occurs specifically when MoveFile() is used, some runtime library functions call MoveFile(), and thus exhibit the same behavior. The most notable is the C runtime library's rename() function. For information about how your particular compiler's runtime library implements rename(), refer to the documentation provided with your compiler.


Additional reference words: 4.00 move rename Novell 3.11
KBCategory: kb3rdparty kbprb
KBSubcategory: NtwkMisc


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: February 27, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.