Jan Stary wrote:
> bin/mv has its own copies of cp.c and mv.c.
> Apparently, they are modifications of cp's cp.c and rm's rm.c,
> used when moving as "copy and remove the source".
>
> In bin/mv/rm.c, the following snippet of rm_file() confuses me:
>
> if (S_ISDIR(sb.st_mode)) {
> warnx("%s: is a directory", f);
> eval = 1;
> continue;
> }
> if (S_ISDIR(sb.st_mode))
> rval = rmdir(f);
> else {
> rval = unlink(f);
> }
>
> If it's a directory, give up.
> And if it's a directory, rmdir();
>
> Is this intentional? In fact, rm_file() and check()
> are not used anywhere else in bin/mv code.
> Is it there to keep the diff to bin/rm smaller?
just some code that wasn't removed when copying over. thanks.