summaryrefslogtreecommitdiff
path: root/usr/src/lib/libast/common/man/touch.3
blob: 908a8b1e6830b80caf0e1904f493e239c4aa999a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
.fp 5 CW
.de Af
.ds ;G \\*(;G\\f\\$1\\$3\\f\\$2
.if !\\$4 .Af \\$2 \\$1 "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
..
.de aF
.ie \\$3 .ft \\$1
.el \{\
.ds ;G \&
.nr ;G \\n(.f
.Af "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7" "\\$8" "\\$9"
\\*(;G
.ft \\n(;G \}
..
.de L
.aF 5 \\n(.f "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de LR
.aF 5 1 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de RL
.aF 1 5 "\\$1" "\\$2" "\\$3" "\\$4" "\\$5" "\\$6" "\\$7"
..
.de EX		\" start example
.ta 1i 2i 3i 4i 5i 6i
.PP
.RS 
.PD 0
.ft 5
.nf
..
.de EE		\" end example
.fi
.ft
.PD
.RE
.PP
..
.TH TOUCH 3
.SH NAME
touch \- set file access and modify times
.SH SYNOPSIS
.L "#include <ast.h>"
.sp
.L "int touch(const char* path, time_t atime, time_t mtime, int force);"
.SH DESCRIPTION
.L touch
sets the access and modify times of the file named by
.LR path .
If
.L "force != 0"
then the file is created if it doesn't exist;
otherwise the file is not created and
.L \-1
is returned.
If
.L "force < 0"
then
.L atime
and
.L mtime
are taken verbatim; otherwise
.L "(time_t)(-1)"
retains the current value for the file and
.L "(time_t)(0)"
uses the current time.
.SH CAVEATS
By default the change time is always changed to the current time.