static char sccsid
[] = "@(#)cpmv.c 4.1 (Berkeley) 9/11/82";
* xcp(f1, f2) copy f1 to f2
* return - 0 ok | FAIL failed
if ((fp1
= fopen(f1
, "r")) == NULL
)
/* check for directory */
if ((s
.st_mode
& S_IFMT
) == S_IFDIR
) {
strcat(full
, lastpart(f1
));
DEBUG(4, "full %s\n", full
);
if ((fp2
= fopen(full
, "w")) == NULL
) {
while((len
= fread(buf
, sizeof (char), BUFSIZ
, fp1
)) > 0)
fwrite(buf
, sizeof (char), len
, fp2
);
* xmv(f1, f2) move f1 to f2
* return 0 ok | FAIL failed