Allows a client to rename a file
#include <nwfile.h>
or
#include <nwcalls.h>
N_EXTERN_LIBRARY(NWCCODE) NWRenameFile (
NWCONN_HANDLE conn,
NWDIR_HANDLE oldDirHandle,
const nstr8 N_FAR *oldFileName,
nuint8 searchAttrs,
NWDIR_HANDLE newDirHandle,
const nstr8 N_FAR *newFileName);
uses calwin32
Function NWRenameFile
(conn : NWCONN_HANDLE;
oldDirHandle : NWDIR_HANDLE;
oldFileName : pnstr8;
searchAttrs : nuint8;
newDirHandle : NWDIR_HANDLE;
newFileName : pnstr8
) : NWCCODE;
(IN) Specifies the NetWare server connection handle containing the file.
(IN) Specifies the directory handle containing the file (or 0 if the oldFileName parameter points to the complete path, including the volume name).
(IN) Points to a string containing the original name of the file being renamed.
(IN) Specifies the attributes to use in searching for the specified file.
(IN) Specifies the new directory handle to contain the specified file.
(IN) Points to a string containing the new name of the file.
These are common return values; see Return Values (Return Values for C) for more information.
The source directory (where the file resides) and the target directory (where the renamed file is to be deposited) do not need to be the same directory. However, the two files must reside on the same server. NWRenameFile cannot move a file from one server to another or from one volume to another.
The searchAttrs parameter is used to include system and/or hidden files. If only the system bit is set in the searchAttrs parameter, all files are affected except hidden files. If only the hidden bit is set, all files are affected except system files. When neither bit is set (0x00), only files that are not designated either hidden or system are affected.
NOTE:A file is designated hidden or system if its corresponding file attribute is set.
The searchAttrs parameter can have the following values:
Since the path length is restricted to 256 bytes, applications must call the NWAllocTemporaryDirectoryHandle function to allocate the dirHandle parameter for path lengths greater than 256 bytes.