realname

(Deprecated) Returns the case-sensitive name of a file.

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

Syntax

  #include <sys/stat.h> 
   
  int  realname (
     const char   *pathname,
     char         *name);
  

Parameters

pathname

(IN) Points to the location and name of the file.

name

(OUT) Points to the case-sensitive name of the file.

Return Values

If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:

Decimal

Constant

Description

1

ENOENT

A component specified in path does not name an existing file or directory, or path is an empty string.

65

ENAMETOOLONG

The length of the path parameter exceeds the maximum path length, or a component in the path parameter is longer than the maximum length for a component.

105

ENOCONTEXT

The calling thread has no context.

Remarks

NetWare is case insensitive, but some applications (such as Java) are case sensitive and need the case sensitive name of a file. Whereas other functions return a case insensitive filename, realname returns a case sensitive filename.

WARNING:If the name buffer is smaller than the returned name, a buffer overwrite occurs. Use getstat with the ST_NAME_BIT to avoid this problem.

See Also