Subject: | BUG - File::Listing parse failure on BSD Linux based systems |
Date: | Thu, 26 Apr 2007 10:49:08 -0700 |
To: | <bug-libwww-perl [...] rt.cpan.org> |
From: | "Michael Grey" <mgrey [...] tivo.com> |
Synopsys :
The output from ' ls -l ' on BSD based Linux systems ( such as Slackware
) provides a different output than in Centos / RH derivatives.
drwxr-xr-x 4 root root 4096 Apr 25 14:57 ..
vs
drwxr-xr-x 21 root root 704 2007-03-22 21:48 ..
Most notably, the date string. This causes the parse / test in
File::Listing to fail,
if (($kind, $size, $date, $name) =
/^([\-FlrwxsStTdD]{10}) # Type and permission bits
.* # Graps
\D(\d+) # File size
\s+ # Some space
(\w{3}\s+\d+\s+(?:\d{1,2}:\d{2}|\d{4})) # Date
\s+ # Some more space
(.*)$ # File name
/x )
which calls
else {
# parse failed, check if the dosftp parse understands it
return(File::Listing::dosftp->line($_,$tz,$error));
}
Which also fails. The result is that 'parse_dir' returns no values.
Changing the regex for Date to :
([\-0-9]{10}\s+(?:\d{1,2}:\d{2}|\d{4})) solves this issue.
Please implement ????? :-)
Thanks
Michael Grey
TiVo