TOUCH(3)
π touch(3) π
okay so this is the Library Functions Manual page for touch, and no cap, it's giving "set file access and modify times" with a lil side of chaos. let's get into it π
β¨ 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. simple enough, bestie.
force != 0β then the file is created if it doesn't exist. slay, new file energy π₯- otherwise β the file is not created, and
-1is returned. sad little return value π
and now the time behavior, because this is where it gets spicy:
force < 0βatimeandmtimeare taken verbatim. like, exactly what you passed, no notes, periodt.- otherwise β
(time_t)(-1)retains the current value for the file, and(time_t)(0)uses the current time. iconic sentinel behavior, fr fr β¨
β οΈ CAVEATS β οΈ
By default the change time is always changed to the current time. highkey important: even when you're just setting access/modify times, the change time gets updated to now. no cap π«Ά
signing off from the Library Functions Manual β version/page TOUCH(3), no date shown on this lil footer, but the vibe is immaculate π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- opensuse-leap 16.0: ksh-devel 93vu-bp160.1.33 Β· CPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms