NWNSRename(3nw)


NWNSRename -- renames an entry in the specified name space, given a path specifying the entry name

Synopsis

   #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);

Description

The parameters are as follows:

conn
(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

 
 --------------------------- 
| 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:


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.

Services

Name Space

NCP calls

0x2222 23 17
Get File Server Information

0x2222 87 04
Rename Or Move A File Or Subdirectory

References

NWGetLongName(3nw)
30 January 1998
© 1998 The Santa Cruz Operation, Inc. All rights reserved.