chiark / gitweb /
wip manpage
[inn-innduct.git] / doc / man / filechan.8
1 .\" $Revision: 5909 $
2 .TH FILECHAN 8
3 .SH NAME
4 filechan \- file-writing backend for InterNetNews
5 .SH SYNOPSIS
6 .B filechan
7 [
8 .BI \-d " directory"
9 ]
10 [
11 .BI \-f " num_fields"
12 ]
13 [
14 .BI \-m " mapfile"
15 ]
16 [
17 .BI \-p " pidfile"
18 ]
19 .SH DESCRIPTION
20 .I Filechan
21 reads lines from standard input and copies certain fields in
22 each line into files named by other fields within the line.
23 .I Filechan
24 is intended to be called by
25 .IR innd (8)
26 as a channel feed.
27 (It is not a full exploder and does not accept commands; see
28 .IR newsfeeds (5)
29 for a description of the difference, and
30 .IR buffchan (8)
31 for an exploder program.)
32 .PP
33 .I Filechan
34 input is interpreted as a sequence of lines.
35 Each line contains a fixed number of initial fields, followed by a
36 variable number of filename fields.
37 All fields in a line are separated by whitespace.
38 The default number of initial fields is one.
39 .PP
40 For each line of input,
41 .I filechan
42 writes the initial fields, separated by whitespace and followed by a
43 newline, to each of the files named in the filename fields.
44 When writing to a file,
45 .I filechan
46 opens it in append mode and tries to lock it and change the
47 ownership to the user and group who owns the directory where the file is
48 being written.
49 .PP
50 Because the time window in which a file is open is very small, complicated
51 flushing and locking protocols are not needed; a
52 .IR mv (1)
53 followed by a
54 .IR sleep (1)
55 for a couple of seconds is sufficient.
56 .SH OPTIONS
57 .TP
58 .B \-f num_fields
59 The ``\fB\-f\fP'' flag may be
60 used to specify a different number of initial fields.
61 .TP
62 .B \-d directory
63 By default,
64 .I filechan
65 writes its output into the directory
66 .IR <pathoutgoing\ in\ inn.conf> .
67 The ``\fB\-d\fP'' flag may be used to specify a directory the program should
68 change to before starting.
69 .TP
70 .B \-p pidfile
71 If the ``\fB\-p\fP'' flag is used, the program will write a line containing
72 its process ID (in text) to the specified file.
73 .TP
74 .B \-m mapfile
75 A map file may be specified by using the ``\fB\-m\fP'' flag.
76 Blank lines and lines starting with a number sign (``#'') are ignored.
77 All other lines should have two host names separated by a colon.
78 The first field is the name that may appear in the input stream;
79 the second field names the file to be used when the name in the first
80 field appears.
81 For example, the following map file may be used to map the short
82 names used in the example below to the full domain names:
83 .PP
84 .RS
85 .nf
86 # This is a comment
87 uunet:news.uu.net
88 foo:foo.com
89 munnari:munnari.oz.au
90 .fi
91 .RE
92 .SH EXAMPLES
93 If
94 .I filechan
95 is invoked with ``\fB\-f 2\fP'' and given the following input:
96 .PP
97 .RS
98 .nf
99 news/software/b/132 <1643@munnari.oz.au> foo uunet
100 news/software/b/133 <102060@litchi.foo.com> uunet munnari
101 comp/sources/unix/2002 <999@news.foo.com> foo uunet munnari
102 .fi
103 .RE
104 .PP
105 Then the file
106 .I foo
107 will have these lines:
108 .PP
109 .RS
110 .nf
111 news/software/b/132 <1643@munnari.oz.au>
112 comp/sources/unix/2002 <999@news.foo.com>
113 .fi
114 .RE
115 .sp
116 the file
117 .I munnari
118 will have these lines:
119 .PP
120 .RS
121 .nf
122 news/software/b/133 <102060@litchi.foo.com>
123 comp/sources/unix/2002 <999@news.foo.com>
124 .fi
125 .RE
126 .sp
127 and the file
128 .I uunet
129 will have these lines:
130 .PP
131 .RS
132 .nf
133 news/software/b/132 <1643@munnari.oz.au>
134 news/software/b/133 <102060@litchi.foo.com>
135 comp/sources/unix/2002 <999@news.foo.com>
136 .fi
137 .RE
138 .SH HISTORY
139 Written by Robert Elz <kre@munnari.oz.au>, flags added by Rich $alz
140 <rsalz@uunet.uu.net>.
141 .de R$
142 This is revision \\$3, dated \\$4.
143 ..
144 .R$ $Id: filechan.8 5909 2002-12-03 05:17:18Z vinocur $
145 .SH "SEE ALSO"
146 buffchan(8),
147 inn.conf(5),
148 innd(8),
149 newsfeeds(5).