---
name: "gfs_utimes"
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_utimes"
---

# gfs\_utimes(3)

set file access and modification times

## NAME

gfs\_utimes - set file access and modification times

## SYNOPSIS

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

**char \*gfs\_utimes (const char \*** *gfarm\_url***, const struct gfarm\_timespec \*** *tsp***);**

## DESCRIPTION

**gfs\_utimes()** sets the access and modification times of the file pointed to by the *gfarm\_url* argument to the value of the *tsp* argument.  The *tsp* argument is an array of gfarm\_timespec structures.  The first array member represents the access time, and the second member represents the modification time.  The gfarm\_timespec structure is:

```
	struct gfarm_timespec {
		unsigned int tv_sec;	/* seconds */
		unsigned int tv_nsec;	/* nanoseconds */
	};
```

If the *tsp* argument is a null pointer, the access and modification times of the file are set to the current time.

## RETURN VALUES

- **NULL**

  The function terminated successfully.

- **GFARM\_ERR\_GFARM\_URL\_PREFIX\_IS\_MISSING**

  *gfarm\_url* does not start with the gfarm: prefix.

- **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.

- **Others**

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

## SEE ALSO

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