Renames an entry in the specified name space, given a path specifying the entry name
#include <nwnamspc.h>
or
#include <nwcalls.h>
NWCCODE N_API NWNSRename (
NWCONN_HANDLE conn,
nuint8 dirHandle,
nuint8 namSpc,
const nstr8 N_FAR *oldName,
nuint16 oldType,
const nstr8 N_FAR *newName,
nuint8 renameFlag);
uses calwin32
Function NWNSRename
(conn : NWCONN_HANDLE;
dirHandle : nuint8;
namSpc : nuint8;
const oldName : pnstr8;
oldType : nuint16;
const newName : pnstr8;
renameFlag : nuint8
) : NWCCODE;
(IN) Specifies the NetWare server connection handle.
(IN) Specifies the directory handle of the parent directory.
(IN) Specifies the name space of oldName (see Section 20.5, Name Space Flag Values).
(IN) Points to the name of the directory or file to rename.
(IN) Specifies the type of oldName:
(IN) Points to the new name (256 bytes maximum).
(IN) Specifies whether name conversion should be done; ignored for NetWare 3.11 and below:
These are common return values; see Return Values (Return Values for C) for more information.
A transaction file cannot be deleted or renamed.
dirHandle must point to the parent directory.
oldName and newName must be valid names containing only one component. dirHandle will specify the path.
The default operation for NWNSRename is to rename the file in all name spaces, report an error if renaming a file as itself, and do nothing with the file compatibility mode. When NW_NAME_CONVERT is passed in the renameFlag parameter, renaming the file to the same name will not report an error and compatibility mode will be set for that file. If NW_NO_NAME_CONVERT is passed in renameFlag, the new name is changed only in the specified name space. When renaming is done the shortening algorithm is used for the DOS and/or MAC name spaces when necessary.
AFP directory and file names (long names) contain 1-31 characters. A long name is a string preceded by one byte which specifies the length of the name. Long names can contain any ASCII character between 1 and 255 except the colon (:) but cannot be terminated by a NULL character (character 0).
The NetWare server automatically generates DOS-style file names (short names) for all AFP directories, as well as for created files and accessed files. The NetWare server maintains both the long name and the short name for each AFP directory and file.
For explanation of how long names are converted to DOS style names, see NetWare 4.x and NetWare 5.x and 6.x.