static char sccsid
[] = "@(#)subdir.c 5.3 (Berkeley) %G%";
* By Tom Truscott, March 1983
* If a prefix is "abc", for example,
* then any file Spool/abc... is mapped to Spool/abc/abc... .
* The first prefix found is used, so D.foo should preceed D. in table.
* Each prefix must be a subdirectory of Spool, owned by uucp!
* Remember: use cron to uuclean these directories daily,
* and check them manually every now and then. Beware complacency!
static char *prefix
[] = {
DLocalX
, /* Outbound 'xqt' request files */
DLocal
, /* Outbound data files */
"D.", /* Other "D." files (remember the "."!) */
"C.", /* "C." subdirectory */
"X.", /* "X." subdirectory */
"TM.", /* Temporaries for inbound files */
* filename mapping kludges to put uucp work files in other directories.
static char fn1
[BUFLEN
], fn2
[BUFLEN
]; /* remapped filename areas */
static int inspool
; /* true iff working dir is Spool */
* return (possibly) remapped string s
static char *tptr
= NULL
;
/* Alternate buffers so "link(subfile(a), subfile(b))" works */
/* if s begins with Spool/, copy that to tptr and advance s */
if (strncmp(s
, Spool
, n
= strlen(Spool
)) == 0 && s
[n
] == '/') {
/* look for first prefix which matches, and make subdirectory */
for (p
= &prefix
[0]; *p
; p
++) {
if (strncmp(s
, *p
, n
= strlen(*p
))==0 && s
[n
] && s
[n
] != '/') {
inspool
= (strcmp(s
, Spool
) == 0);
* return possibly corrected directory for searching
if (strcmp(d
, Spool
) == 0)