NWRenameFile

Allows a client to rename a file

NetWare Server:3.11, 3.12, 3.2, 4.x, 5.x, 6.x
Platform:Windows NT, Windows 95, Windows 98
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:File System

Syntax

   #include <nwfile.h> 
   or 
   #include <nwcalls.h> 
    
   N_EXTERN_LIBRARY(NWCCODE) NWRenameFile ( 
      NWCONN_HANDLE       conn,  
      NWDIR_HANDLE        oldDirHandle,  
      const nstr8 N_FAR  *oldFileName,  
      nuint8              searchAttrs,  
      NWDIR_HANDLE        newDirHandle,  
      const nstr8 N_FAR  *newFileName);
   

Delphi Syntax

   uses calwin32 
    
   Function NWRenameFile 
     (conn : NWCONN_HANDLE; 
      oldDirHandle : NWDIR_HANDLE; 
      oldFileName : pnstr8; 
      searchAttrs : nuint8; 
      newDirHandle : NWDIR_HANDLE; 
      newFileName : pnstr8 
   ) : NWCCODE;
   

Parameters

conn

(IN) Specifies the NetWare server connection handle containing the file.

oldDirHandle

(IN) Specifies the directory handle containing the file (or 0 if the oldFileName parameter points to the complete path, including the volume name).

oldFileName

(IN) Points to a string containing the original name of the file being renamed.

searchAttrs

(IN) Specifies the attributes to use in searching for the specified file.

newDirHandle

(IN) Specifies the new directory handle to contain the specified file.

newFileName

(IN) Points to a string containing the new name of the file.

Return Values

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

0x0000

SUCCESSFUL

0x8801

INVALID_CONNECTION

0x8987

WILD_CARDS_IN_CREATE_FILE_NAME or CREATE_FILENAME_ERROR

0x898B

NO_RENAME_PRIVILEGES

0x898D

SOME_FILES_AFFECTED_IN_USE

0x898E

NO_FILES_AFFECTED_IN_USE

0x898F

SOME_FILES_AFFECTED_READ_ONLY

0x8990

NO_FILES_AFFECTED_READ_ONLY

0x8991

SOME_FILES_RENAMED_NAME_EXISTS

0x8992

NO_FILES_RENAMED_NAME_EXISTS

0x8996

SERVER_OUT_OF_MEMORY

0x8998

VOLUME_DOES_NOT_EXIST

0x899A

RENAMING_ACROSS_VOLUMES

0x899B

BAD_DIRECTORY_HANDLE

0x899C

INVALID_PATH

0x89A1

DIRECTORY_IO_ERROR

0x89FD

BAD_STATION_NUMBER

0x89FF

NO_FILES_FOUND_ERROR

Remarks

The source directory (where the file resides) and the target directory (where the renamed file is to be deposited) do not need to be the same directory. However, the two files must reside on the same server. NWRenameFile cannot move a file from one server to another or from one volume to another.

The searchAttrs parameter is used to include system and/or hidden files. If only the system bit is set in the searchAttrs parameter, all files are affected except hidden files. If only the hidden bit is set, all files are affected except system files. When neither bit is set (0x00), only files that are not designated either hidden or system are affected.

NOTE:A file is designated hidden or system if its corresponding file attribute is set.

The searchAttrs parameter can have the following values:

C Value

Delphi Value

Value Name

0x00

$00

FA_NORMAL

0x01

$01

FA_READ_ONLY

0x02

$02

FA_HIDDEN

0x04

$04

FA_SYSTEM

0x08

$08

FA_EXECUTE_ONLY

0x10

$10

FA_DIRECTORY

0x20

$20

FA_NEEDS_ARCHIVED

0x80

$80

FA_SHAREABLE

Since the path length is restricted to 256 bytes, applications must call the NWAllocTemporaryDirectoryHandle function to allocate the dirHandle parameter for path lengths greater than 256 bytes.

NCP Calls

See Also

NWAllocTemporaryDirectoryHandle