Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > R

realpath(3X)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

realpath — resolve pathname

SYNOPSIS

#include <stdlib.h>

char *realpath(const char *file_name__restrict fP, char *resolved_name__restrict);

DESCRIPTION

The realpath() function derives, from the pathname pointed to by file_name, an absolute pathname that names the same file, whose resolution does not involve ., .., or symbolic links. The generated pathname is stored, up to a maximum of {PATH_MAX} bytes, in the buffer pointed to by resolved_name.

RETURN VALUE

On successful completion, realpath() returns a pointer to the resolved name. Otherwise, realpath() returns a null pointer and sets errno to indicate the error, and the contents of the buffer pointed to by resolved_name are undefined.

ERRORS

The realpath() function will fail if:

EACCES

Read or search permission was denied for a component of file_name.

EINVAL

Either the file_name or resolved_name argument is a null pointer.

EIO

An error occurred while reading from the file system.

ELOOP

Too many symbolic links were encountered in resolving path.

ENAMETOOLONG

The file_name argument is longer than {PATH_MAX} or a pathname component is longer than {NAME_MAX}.

ENOENT

A component of file_name does not name an existing file or file_name points to an empty string.

ENOTDIR

A component of the path prefix is not a directory.

The realpath() function may fail if:

ENAMETOOLONG

Pathname resolution of a symbolic link produced an intermediate result whose length exceeds {PATH_MAX}.

ENOMEM

Insufficient storage space is available.

CHANGE HISTORY

First released in Issue 4, Version 2.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.