Welcome to little lamb

Code » limb » master » tree

[master] / src / doc / posixplz.h / touch.3.md

% limb manual
% touch(3)
% limb 0.1.0
% 2023-07-24

# NAME

touch - update a file's atime & mtime timestamps

# SYNOPSIS

    #include <limb/posixplz.h>

```pre hl
int touch(const char *<em>file</em>)
```

# DESCRIPTION

The `touch`() function will update both the `atime` and `mtime` timestamps of
the file named `file`, creating it if it doesn't exist.

# RETURN VALUE

The `touch`() function returns 1 on success. Otherwise it returns 0 and sets
`errno` to indicate the error.

# ERRORS

The `touch`() function may fail for any of the errors described for
[open_create](3).

It may also fail and set `errno` for the errors described for [futimens](3),
[futimes](3) or [utimes](3) depending on what's available on the system.

! NOTE:
! The availability of functions is determined at compile-time, during the
! compilation of skalibs.