---
name: "gfs_realpath"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.4.1-1.1"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_realpath"
---

# gfs\_realpath(3)

resolve pathname in Gfarm filesystem

## NAME

gfs\_realpath - resolve pathname in Gfarm filesystem

## SYNOPSIS

**#include \<gfarm/gfarm.h\>**

**char \*gfs\_realpath (const char \*** *gfarm\_url***, char \*\*** *resolved\_pathp***);**

## DESCRIPTION

**gfs\_realpath** expands a home directory '~' and resolves references to '.', '..' and extra '/' characters in the null terminated string pointed to by *gfarm\_url* and stores the canonicalized absolute pathname to dynamically allocated memory space whose pointer is returned to *resolved\_pathp*.  It will be necessary to free the dynamically allocated memory space pointed to by *resolved\_pathp*.

## RETURN VALUES

- **NULL**

  The function terminated successfully.

- **GFARM\_ERR\_NO\_MEMORY**

  Insufficient memory was available.

- **GFARM\_ERR\_NOT\_A\_DIRECTORY**

  A component of the path prefix is not a directory.

- **GFARM\_ERR\_INVALID\_ARGUMENT**

  *gfarm\_url* is NULL.

- **GFARM\_ERR\_PERMISSION\_DENIED**

  *gfarm\_url* points outside your accessible address space.

- **GFARM\_ERR\_NO\_SUCH\_OBJECT**

  *gfarm\_url* does not exist.

- **Others**

  An error except the above occurred.  The reason is shown by its pointed strings.
