File: filechan.8

package info (click to toggle)
inn2 2.2.2.2000.01.31-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,424 kB
  • ctags: 5,722
  • sloc: ansic: 61,219; perl: 9,939; sh: 5,644; makefile: 1,695; awk: 1,567; yacc: 1,548; lex: 249; tcl: 3
file content (144 lines) | stat: -rw-r--r-- 3,444 bytes parent folder | download
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
.\" $Revision: 1.1.2.1 $
.TH FILECHAN 8
.SH NAME
filechan \- file-writing backend for InterNetNews
.SH SYNOPSIS
.B filechan
[
.BI \-d " directory"
]
[
.BI \-f " fields"
]
[
.BI \-m " mapfile"
]
[
.BI \-p " pidfile"
]
.SH DESCRIPTION
.I Filechan
reads lines from standard input and copies certain fields in
each line into files named by other fields within the line.
.I Filechan
is intended to be called by
.IR innd (8)
as a channel feed.
(It is not a full exploder and does not accept commands; see
.IR newsfeeds (5)
for a description of the difference and
.IR buffchan (8)
for an exploder program.)
.PP
.I Filechan
input is interpreted as a set of lines.
Each line contains a fixed number of initial fields, followed by a
variable number of filename fields.
All fields in a line are separated by whitespace.
The default number of initial fields is one.
.PP
For each line of input,
.I filechan
writes the initial fields, separated by whitespace and followed by a
newline, to each of the files named in the filename fields.
When writing to a file,
.I filechan
opens it in append mode and tries to lock it and change the
ownership to the user and group who owns the directory where the file is
being written.
.SH OPTIONS
.TP
.B \-f
The ``\fB\-f\fP'' flag may be
used to specify a different number of initial fields.
.TP
.B \-d
By default,
.I filechan
writes its output into the directory
.IR <pathoutgoing\ in\ inn.conf> .
The ``\fB\-d\fP'' flag may be used to specify a directory the program should
change to before starting.
.TP
.B \-p
If the ``\fB\-p\fP'' flag is used, the program will write a line containing
its process ID (in text) to the specified file.
.PP
If
.I filechan
is invoked with ``\fB\-f 2\fP'' and given the following input:
.RS
.nf
news/software/b/132 <1643@munnari.oz.au> foo uunet
news/software/b/133 <102060@litchi.foo.com> uunet munnari
comp/sources/unix/2002 <999@news.foo.com> foo uunet munnari
.fi
.RE
.PP
Then the file
.I foo
will have these lines:
.RS
.nf
news/software/b/132 <1643@munnari.oz.au>
comp/sources/unix/2002 <999@news.foo.com>
.fi
.RE
.sp
the file
.I munnari
will have these lines:
.RS
.nf
news/software/b/133 <102060@litchi.foo.com>
comp/sources/unix/2002 <999@news.foo.com>
.fi
.RE
.sp
and the file
.I uunet
will have these lines:
.RS
.nf
news/software/b/132 <1643@munnari.oz.au>
news/software/b/133 <102060@litchi.foo.com>
comp/sources/unix/2002 <999@news.foo.com>
.fi
.RE
.PP
Because the time window in which a file is open is very small, complicated
flushing and locking protocols are not needed; a
.IR mv (1)
followed by a
.IR sleep (1)
for a couple of seconds is sufficient.
.TP
.B \-m
A map file may be specified by using the ``\fB\-m\fP'' flag.
Blank lines and lines starting with a number sign (``#'') are ignored.
All other lines should have two host names separated by a colon.
The first field is the name that may appear in the input stream;
the second field names the file to be used when the name in the first
field appears.
For example, the following map file may be used to map the short
names above to the full domain names:
.RS
.nf
# This is a comment
uunet:news.uu.net
foo:foo.com
munnari:munnari.oz.au
.fi
.RE
.SH HISTORY
Written by Robert Elz <kre@munnari.oz.au>, flags added by Rich $alz
<rsalz@uunet.uu.net>.
.de R$
This is revision \\$3, dated \\$4.
..
.R$ $Id: filechan.8,v 1.1.2.1 1999/06/12 08:22:30 kondou Exp $
.SH "SEE ALSO"
buffchan(8),
inn.conf(5),
innd(8),
newsfeeds(5).