Reference

touch(3)

set file access and modify times

NAME

touch - set file access and modify times

SYNOPSIS

$1$2#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>#include <ast.h>

$1$2int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);int touch(const char* path, time_t atime, time_t mtime, int force);

DESCRIPTION

$1$2touchtouchtouchtouchtouchtouchtouchtouch sets the access and modify times of the file named by $1$2pathpathpathpathpathpathpathpath If $1$2force != 0force != 0force != 0force != 0force != 0force != 0force != 0force != 0 then the file is created if it doesn't exist; otherwise the file is not created and $1$2-1-1-1-1-1-1-1-1 is returned. If $1$2force < 0force < 0force < 0force < 0force < 0force < 0force < 0force < 0 then $1$2atimeatimeatimeatimeatimeatimeatimeatime and $1$2mtimemtimemtimemtimemtimemtimemtimemtime are taken verbatim; otherwise $1$2(time_t)(-1)(time_t)(-1)(time_t)(-1)(time_t)(-1)(time_t)(-1)(time_t)(-1)(time_t)(-1)(time_t)(-1) retains the current value for the file and $1$2(time_t)(0)(time_t)(0)(time_t)(0)(time_t)(0)(time_t)(0)(time_t)(0)(time_t)(0)(time_t)(0) uses the current time.

CAVEATS

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