static char sccsid
[] = "@(#)expfile.c 5.5 (Berkeley) %G%";
* return codes: 0 - Ordinary spool area file
* FAIL - no Wrkdir name available
register char *fpart
, *p
;
for (fpart
= file
+ 1, up
= user
; *fpart
!= '\0'
&& *fpart
!= '/'; fpart
++)
if (!*user
|| gninfo(user
, &uid
, full
) != 0) {
* check if directory name
* return codes: 0 - not directory | 1 - is directory
ret
= stat(subfile(name
), &s
);
if ((s
.st_mode
& S_IFMT
) == S_IFDIR
)
* make all necessary directories
for (p
= dir
+ 1;; p
++) {
if ((p
= index(p
, '/')) == NULL
)
DEBUG(4, "mkdir - %s\n", dir
);
* expfile and check return
* print error if it failed.
* return code - SUCCESS - ok; FAIL if expfile failed
if (expfile(file
) != FAIL
)
/* could not expand file name */
/* the gwd routine failed */
logent("CAN'T EXPAND FILENAME - PWD FAILED", file
+1);