table of contents
other sections
TOUCH(3) | Library Functions Manual | TOUCH(3) |
NAME¶
touch - set file access and modify times
SYNOPSIS¶
#include <ast.h>
int touch(const char* path, time_t atime, time_t mtime, int force);
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 < 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¶
By default the change time is always changed to the current time.