Knowledge Base

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

Article ID: 147437

Article Last Modified on 11/21/2006


APPLIES TO


This article was previously published under Q147437
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.

Keywords: kb3rdparty kbapi kbnetwork kbprb kbwnet KB147437