TOUCH(3ast) TOUCH(3ast)

# [NAME](#NAME)

touch - set file access and modify times

# [SYNOPSIS](#SYNOPSIS)

#include &lt;ast.h&gt;

int touch(const char* path, time\_t atime, time\_t mtime, int force);

# [DESCRIPTION](#DESCRIPTION)

touch sets the access and modify times of the file named by path. If force != 0 then the file is created if it doesn't exist; otherwise the file is not created and -1 is returned. If force &lt; 0 then atime and mtime are taken verbatim; otherwise (time\_t)(-1) retains the current value for the file and (time\_t)(0) uses the current time.

# [CAVEATS](#CAVEATS)

By default the change time is always changed to the current time.

---

Document: touch(3ast) from ksh 1.0.10-r37 (Chainguard OS)
Source: https://github.com/ksh93/ksh
