NXFileRenameWithHandle

Renames an open file.

Library:LibC
Classification:NKS
Service:File and Directory I/O

Syntax

  #include <nks/fsio.h> 
  
  int NXFileRenameWithHandle (
     NXHandle_t     fileHandle,
     NXPathCtx_t    targetPathCtx,
     const void    *newname,
     NXBool_t       overwrite); 
  

Parameters

fileHandle

(IN) Specifies a handle to a previously opened file.

targetPathCtx

(IN) Points to the file system path context for the renamed object. Along with the targetname parameter, it specifies the new name of the object.

newname

(IN) Points to a new name (in Unicode or ASCII) for the specified file.

overwrite

(IN) Not currently used. Set to 0.

Return Values

If successful, returns 0. Otherwise, returns one of the following:

Decimal

Hex

Constant

Description

1

0x01

NX_ENOENT

A component of the path prefix specified by newname does not exist, or one of them is NULL.

4

0x04

NX_EBADF

Invalid path context.

6

0x06

NX_EACCES

Insufficient rights to the object.

7

0x07

NX_EEXIST

The target object already exists.

24

0x18

NX_EAGAIN

Resource exhaustion prevented successful completion of the call.

65

0x41

NX_ENAMETOOLONG

The name contents are longer than system permitted name length.

79

0x4F

NX_ENOTSUP

The operation is not supported on this volume type.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXFileRenameWithHandle renames an open file. Currently, it is only supported on NSS volumes. On traditional volumes, remote file systems, or the DOS partition, it returns ENOTSUP.

See Also

NXRemove