NWNSRename

Renames an entry in the specified name space, given a path specifying the entry name

Local Servers:blocking
Remote Servers:blocking
NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:NLM, Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Name Space

Syntax

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

Delphi Syntax

   uses calwin32 
    
   Function NWNSRename 
     (conn : NWCONN_HANDLE; 
      dirHandle : nuint8; 
      namSpc : nuint8; 
      const oldName : pnstr8; 
      oldType : nuint16; 
      const newName : pnstr8; 
      renameFlag : nuint8 
   ) : NWCCODE;
   

Parameters

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 (see Section 20.5, Name Space Flag Values).

oldName

(IN) Points to the name of the directory or file to rename.

oldType

(IN) Specifies the type of oldName:

C Value

Delphi Value

Constant

0x8000

$0800

NW_TYPE_FILE

0x0010

$0010

NW_TYPE_SUBDIR

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:

C Value

Delphi Value

Constant

0x03

$03

NW_NAME_CONVERT

0x04

$04

NW_NO_NAME_CONVERT

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x890A

NLM_INVALID_CONNECTION

0x8998

VOLUME_DOES_NOT_EXIST

0x899B

BAD_DIRECTORY_HANDLE

0x899C

INVALID_PATH

0x899E

INVALID_FILENAME

Remarks

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.

NCP Calls

See Also

NWGetLongName