(IN) Specifies the NetWare server connection handle.
dirHandle
(IN) Specifies the directory handle of the parent directory.
namSpc
(IN) Specifies the name space of oldName.
oldName
(IN) Points to the name of the directory or file to rename.
oldType
(IN) Specifies the type of oldName.
newName
(IN) Points to the new name (256 bytes maximum).
renameFlag
(IN) Specifies whether name conversion should be done; ignored for NetWare 3.11 and below.
Return values
0x0000
SUCCESSFUL
0x8801
INVALID_CONNECTION
0x8998
VOLUME_DOES_NOT_EXIST
0x899B
BAD_DIRECTORY_HANDLE
0x899C
INVALID_PATH
0x899E
INVALID_FILENAME
Notices
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
renameFlag can be one of the following:
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:
If a long name containing no periods is converted to a short name, the first eight valid DOS characters of the long name are used:
Long Name: THIS IS A NAME
Short Name: THISISAN
If a long name contains a period within the first nine valid DOS characters, the first eight characters before the period and the first three characters after the last period are
used:
Long Name: THIS.IS.A.NAME
Short Name: THIS.NAM
If an application creates in the same directory two files whose initial 8 short name characters are the same, the NetWare server replaces the last character of the second file's
short name with an ascending decimal integer guaranteeing its uniqueness:
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
NOTE:
If the first file in Example 1 is subsequently deleted, a third file whose DOS name would have been identical to the first and second names is created in that directory. The
third name is identical to the deleted first name and will not be appended with a decimal integer.