-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathkqfm.1
160 lines (155 loc) · 2.86 KB
/
kqfm.1
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "KQFM" "1" "May 2012" "" ""
.
.SH "NAME"
\fBkqfm\fR \- monitor a file or a set of files for changes
.
.SH "SYNOPSIS"
\fBkqfm\fR
.
.br
\fBkqfm\fR \fB\-e\fR \fIevent_flag\fR | \fB\-\-event=\fR\fIevent_flag\fR
.
.br
.
.SH "DESCRIPTION"
\fBkqfm\fR takes in a newline delimited set of paths on \fBstdin\fR and watches them for changes\. When a change occurs (any by default, can be filtered with \fB\-e\fR \- see \fBEVENT FLAGS\fR), \fBkqfm\fR outputs a line describing the changes\. The output line is tab delimited \- the field in the first position is the path the change happened on, the second is a comma delimited string representing the change(s) that occurred\.
.
.SH "OPTIONS"
.
.TP
\fB\-e\fR \fIevent_flag\fR, \fB\-\-event=\fR\fIevent_flag\fR
The event flag to watch\. This option can be specified more than once, for example: \fBkqfm \-e write \-e attrib\fR\.
.
.TP
\fB\-v\fR, \fB\-\-version\fR
Print program version\.
.
.SH "EVENT FLAGS"
Available flags are:
.
.IP "\(bu" 4
\fBDELETE\fR
.
.br
The unlink() system call was called on the file referenced by the descriptor\.
.
.IP "\(bu" 4
\fBWRITE\fR
.
.br
A write occurred on the file referenced by the descriptor\.
.
.IP "\(bu" 4
\fBEXTEND\fR
.
.br
The file referenced by the descriptor was extended\.
.
.IP "\(bu" 4
\fBATTRIB\fR
.
.br
The file referenced by the descriptor had its attributes changed\.
.
.IP "\(bu" 4
\fBLINK\fR
.
.br
The link count on the file changed\.
.
.IP "\(bu" 4
\fBRENAME\fR
.
.br
The file referenced by the descriptor was renamed\.
.
.IP "\(bu" 4
\fBREVOKE\fR
.
.br
Access to the file was revoked via revoke(2) or the underlying fileystem was unmounted\.
.
.IP "" 0
.
.P
See \fBEVFILT_VNODE\fR under \fBkqueue(2)\fR for more details on these flags\.
.
.SH "SIGNALS"
Sending \fBSIGUSR1\fR to \fBkqfm\fR will cause it to dump a list of the paths it\'s currently monitoring to \fBstderr\fR\.
.
.IP "" 4
.
.nf
$ echo "/tmp/testfile" | kqfm &
[1] 25826
$ killall \-USR1 kqfm
/tmp/testfile
$ touch /tmp/testfile
/tmp/testfile ATTRIB
.
.fi
.
.IP "" 0
.
.SH "EXAMPLES"
Watch a single file for all changes:
.
.IP "" 4
.
.nf
$ echo /tmp/example_path | kqfm &
[1] 577
$ touch /tmp/example_path
/tmp/example_path ATTRIB
.
.fi
.
.IP "" 0
.
.P
Watch a single file for writes only:
.
.IP "" 4
.
.nf
$ echo /tmp/example_path | kqfm \-e write &
[1] 580
$ echo "what" > /tmp/example_path
/tmp/example_path WRITE
.
.fi
.
.IP "" 0
.
.P
Watch all CSS files in a directory for writes:
.
.IP "" 4
.
.nf
$ find \. \-name \'*\.css\' | kqfm \-e write
.
.fi
.
.IP "" 0
.
.P
Watch a single file and run a command when it changes in any way:
.
.IP "" 4
.
.nf
$ echo "file\.c" | kqfm | while read changes; do make; done
.
.fi
.
.IP "" 0
.
.SH "AUTHOR"
Gabriel Gironda \fIgabriel@gironda\.org\fR
.
.SH "SEE ALSO"
kqueue(2), kqfm home page \fIhttps://github\.com/gabrielg/kqfm\fR