On Fri, May 30, 2014 at 08:06:24PM +0200, Harald Becker wrote:
> Hi Joshua !
> 
> On 29-05-2014 18:41 Joshua Judson Rosen <[email protected]>
> wrote:
> 
> >But why is ls able to match the files when rm is not able to
> >remove them?
> 
> The problem happens on the opposite direction you expect. It is
> not the create/open/unlink which modify the file name it is the
> directory scan. ls doesn't really match the filename. It just
> scans the directory, filters with given file name masks, then
> display what it got.

ls never performas any filtering. If ls is given a directory name, it
just reads the entries with readdir(); no 'matching' needs to take
place at all. If it's given a glob pattern, that glob never reaches
ls; it's expanded by the shell. If you quote the glob to actually pass
it to ls, ls will not process it as a glob pattern; it's treated as a
literal filename containing *'s or ?'s. So I don't understand what
you're claiming happens.

> But on some unusual file names the directory
> scan gives names which does not exactly match the name stored on
> file system. They can be displayed, but used for an remove or
> move operation the stat/unlink fails. This usually happens
> when the names contain control or unprintable characters
> (e.g. a byte with all zero) which get removed by the
> kernel/file system driver.

Printability has nothing to do with processing the filename. And a
zero byte fundamentally cannot be in a filename (the filename in the
directory table consists of those characters up to, and not including,
any zero byte stored).

Rich
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to