[EMAIL PROTECTED] (Steven M. Schweda) writes:

> I haven't actually looked, but if the code does _not_ assume that
> the last thing on the line is the file name, then it would seem to
> need some work.

The code does assume that the last thing on the line is the file name.
The twist is that a file name can contain spaces, in which case it's
the last two, three, etc., "things".

Declaring that the file name starts at the ninth column would not work
because of BSD and SYSV directory listing having a different column
count -- SYSV includes group name by default, while BSD doesn't.  So I
used month name as an anchor, declaring the file name to begin at the
third column after it.  That worked well for directory listings in the
"C" locale, which are still prevalent.  It breaks completely when
confronted with non-English month names or with different order of
columns, as seems to be the case here.

As you said, parsing UNIX directory listings is a nightmare.  If
someone has a suggestion for better heuristics, please go ahead and
suggest.

Reply via email to