1FILECHAN(8)               InterNetNews Documentation               FILECHAN(8)
2
3
4

NAME

6       filechan - File-writing backend for INN
7

SYNOPSIS

9       filechan [-d directory] [-f num-fields] [-m map-file] [-p pid-file]
10

DESCRIPTION

12       filechan reads lines from standard input and copies the initial fields
13       in each line to the files named by the remaining fields on the line.
14       filechan is intended to be called by innd as a channel feed.  (It is
15       not a full exploder and does not accept commands; see newsfeeds(5) for
16       a description of the difference, and buffchan(8) for an exploder
17       program.)
18
19       The input is interpreted as a sequence of lines.  Each line contains a
20       fixed number of initial fields, followed by a variable number of
21       filename fields.  All fields in a line are separated by whitespace and
22       do not contain any whitespace.  The default number of initial fields is
23       one.
24
25       For each line of input, filechan writes the initial fields, separated
26       by a space and followed by a newline, to each of the files named in the
27       filename fields.  When writing to a file, filechan opens it in append
28       mode and tries to lock it and change the ownership to the user and
29       group owning the directory where the file is being written.
30
31       Because the time window in which a file is open is very small,
32       complicated flushing and locking protocols have not been implemented
33       and are not necessarily needed for the way filechan is called and
34       works; mv(1) followed by sleep(1) for a couple of seconds is
35       sufficient.
36

OPTIONS

38       -d directory
39           By default, filechan writes its output into the pathoutgoing
40           directory.  This flag may be used to specify a directory the
41           program should change to before starting.
42
43       -f num-fields
44           This flag specifies a different number of initial fields.
45
46       -m map-file
47           A map file may be specified by using this flag.  Blank lines and
48           lines starting with a number sign ("#") are ignored.  All other
49           lines should have two host names separated by a colon.  The first
50           field is the name that may appear in the input stream; the second
51           field names the file to be used when the name in the first field
52           appears.
53
54           For example, the following map file may be used to map the short
55           names used in the example below to the full domain names:
56
57               # This is a comment.
58               uunet:news.uu.net
59               foo:foo.com
60               munnari:munnari.oz.au
61
62       -p pid-file
63           If this flag is used, filechan will write a line containing its
64           process ID (in text) to the specified file.
65

EXAMPLES

67       If filechan is invoked with "-f 2" and given the following input:
68
69           news.software.nntp <1643@munnari.oz.au> foo uunet
70           news.software.nntp <102060@litchi.foo.com> uunet munnari
71           comp.sources.unix <999@news.foo.com> foo uunet munnari
72
73       then the file foo in pathoutgoing will have these lines:
74
75           news.software.nntp <1643@munnari.oz.au>
76           comp.sources.unix <999@news.foo.com>
77
78       the file munnari in pathoutgoing will have these lines:
79
80           news.software.nntp <102060@litchi.foo.com>
81           comp.sources.unix <999@news.foo.com>
82
83       and the file uunet in pathoutgoing will have these lines:
84
85           news.software.nntp <1643@munnari.oz.au>
86           news.software.nntp <102060@litchi.foo.com>
87           comp.sources.unix <999@news.foo.com>
88
89       Using filechan this way can be done in newsfeeds with for instance:
90
91           foo:*,@misc.*:Ap,Tm:filechan!
92           munnari:*,@rec.*:Ap,Tm:filechan!
93           uunet:*:Ap,Tm:filechan!
94           filechan!:*:Tc,WGm*:<pathbin>/filechan -f 2
95
96       It will generate the examples above.  See the "W" flag in newsfeeds(5)
97       for how to parameter the output.
98

HISTORY

100       Written by Robert Elz <kre@munnari.oz.au>, flags added by Rich $alz
101       <rsalz@uunet.uu.net>.  Rewritten into POD by Julien Elie.
102

SEE ALSO

104       buffchan(8), newsfeeds(5).
105
106
107
108INN 2.6.5                         2022-01-23                       FILECHAN(8)
Impressum