---
name: "gfs_stat"
section: "3"
platform: "linux"
package: "libgfarm-dev"
version: "2.7.20+dfsg-1.2+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/gfs_stat"
---

# gfs\_stat(3)

get file status

## NAME

gfs\_stat - get file status

## SYNOPSIS

```
#include <gfarm/gfarm.h>
```

**gfarm\_error\_t gfs\_stat(const char \*** *gfarm\_url***, struct gfs\_stat \*** *status***);**

## DESCRIPTION

**gfs\_stat()** return information about the specified file pointed to by *gfarm\_url*, and fills in the buffer pointed to by *status*. Since *status* includes a pointer to dynamically allocated memory space, it is necessary to free the memory space by [gfs\_stat\_free(3)](/gfs_stat_free/3.md).

## RETURN VALUES

**GFARM\_ERR\_NO\_ERROR**

The function terminated successfully.

**GFARM\_ERR\_NO\_MEMORY**

Insufficient memory was available.

**GFARM\_ERR\_AUTHENTICATION**

User authentication failed when connecting to [gfmd(8)](/gfmd/8.md).

**GFARM\_ERR\_PERMISSION\_DENIED**

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

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

*gfarm\_url* does not exist.

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

A component of the path prefix is not a directory.

Others

An error except the above occurred. The reason is shown by **gfarm\_error\_string**(3).

## SEE ALSO

[**gfs\_stat\_free**(3)](/gfs_stat_free/3.md)
