#include <nwnamspc.h> or #include <nwcalls.h>NWCCODE N_API NWNSRename (NWCONN_HANDLE conn, nuint8 dirHandle, nuint8 namSpc, pnstr8 oldName, nuint16 oldType, pnstr8 newName, nuint8 renameFlag);
dirHandle must point to the parent directory.
oldName and newName must be valid names containing only one component. No relative paths should be used.
oldType can be one of the following values:
C Value | Value Name |
---|---|
0x8000 | NW_TYPE_FILE |
0x0010 | NW_TYPE_SUBDIR |
--------------------------- | C Value| Value Name | |--------|-----------------| | 0x8000 | NW_TYPE_FILE | |--------|-----------------| | 0x0010 | NW_TYPE_SUBDIR | |--------|-----------------|
renameFlag can be one of the following:
C Value | Value Name |
---|---|
0x03 | NW_NAME_CONVERT |
0x04 | NW_NO_NAME_CONVERT |
------------------------------- | C Value| Value Name | |--------|---------------------| | 0x03 | NW_NAME_CONVERT | |--------|---------------------| | 0x04 | NW_NO_NAME_CONVERT | |--------|---------------------|
The default operation for this function is to rename the file in all name spaces, report an error if renaming a file as itself, and do nothing with the file's compatibility mode. When NW_NAME_CONVERT is passed in renameFlag, 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.
AppleTalk Filing Protocol directory and file names (long names) contain 1-31 characters. A long name is a Pascal 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 AppleTalk Filing Protocol directories, as well as for created files and accessed files. The NetWare server maintains both the long name and the short name for each AppleTalk Filing Protocol directory and file.
NetWare uses the following conventions to convert AppleTalk Filing Protocol names to DOS names:
Long Name: THIS IS A NAME Short Name: THISISAN
Long Name: THIS.IS.A.NAME Short Name: THIS.NAM
Example 1
Long Name: THIS IS THE FIRST FILE Short Name: THISISTH Long Name: THIS IS THE SECOND FILE Short Name: THISIST1
Example 2
Long Name: THIS IS A 1 TIME OFFER Short Name: THISISA1 Long Name: THIS IS A 1 TIME DEAL Short Name: THISISA2
Name Space