[BusyBox] mv is deleting files!

Rainer Weikusat rainer.weikusat at sncag.com
Fri Jul 15 07:30:13 UTC 2005


Rob Landley <rob at landley.net> writes:

[...]

> Changing the >= to a > fixes the behavior, but then we don't get an error
> message.  The interesting question is why the heck does cp_mv_stat.c want
> to single out ENOENT?

Probably to avoid duplicating the error logic that's already part of
the copy function. 

> The case I can think of is that when we can access a
> file in a directory we can't list, we still want cp to work.

stat (and consequenlty, cp_mv_stat) work just fine in this case.

> Okay, the response from the gnu tools to some of these corner cases is just
> _weird_.  Try to chmod a directory to 444 and then ls its contents.  You get
> a list of the files in it with "permission denied" for each one.

That's perfectly sensible: Directory read permission is needed to read
the directory, which accounts for the filelist. To stat the files
requires execute permission. That's were the 'permission denied' comes
from. If you don't use color-ls, GNU-ls works as you would expect for
the 'plain' cases (which don't need stat).



More information about the busybox mailing list