NXFileGetLengthWithHandle

Returns the length of a file specified by a file handle.

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

Syntax

  #include <nks/fsio.h> 
  
  int NXFileGetLengthWithHandle (
     NXHandle_t    fileHandle,
     NXOffset_t   *length);
  

Parameters

fileHandle

(IN) Specifies a file handle to a previously opened file (rather than a path).

length

(OUT) Points to a variable to receive the result.

Return Values

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

Decimal

Hex

Constant

Description

1

0x01

NX_ENOENT

The file does not exist.

4

0x04

NX_EBADF

The fileHandle parameter does not refer to a valid description of a file.

6

0x06

NX_EACCES

Insufficient rights to the object.

9

0x09

NX_EINVAL

A pathCtx was specified but pathname indicates a full path

Remarks

NXFileGetLengthWithHandle is useful when working with Sun's JVM, which calls the stat function more frequently than any other operation (in order to know how much space to allocate to hold the Java source code). NXFileGetLengthWithHandle is meant to be a high-speed function to optimize using the JVM.

See Also