NXRemove

Removes a file, FIFO, device, etc.

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

Syntax

  #include <nks/fsio.h> 
  
  int NXRemove (
     NXPathCtx_t   pathCtx, 
     const void   *pathname); 
  

Parameters

pathCtx

(IN) Specifies the file system path context. Along with the pathname parameter, it specifies the object.

pathname

(IN) Points to the Unicode or ASCII name of the object to remove.

Return Values

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

Decimal

Hex

Constant

Description

1

0x01

NX_ENOENT

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

4

0x04

NX_EBADF

Invalid path context.

6

0x06

NX_EACCES

Insufficient rights to the object.

9

0x09

NX_EINVAL

A path context was specified but pathname indicates a full path.

24

0x18

NX_EAGAIN

Resource exhaustion prevented successful completion of the call.

65

0x41

NX_ENAMETOOLONG

The filename is longer than system permitted name length.

105

0x69

NX_ENOCONTEXT

The calling thread has no NKS context.

Remarks

NXRemove removes a named file object. After a filename is successfully removed, attempts to open that file by the same name fail unless the file is recreated.

Before deleting a read-only file, its attributes must be changed.

See Also