Subject: | File::Listing::dosftp->list cannot handle MM-DD-YYYY date formats |
Date: | Tue, 23 Jun 2015 13:45:32 -0400 |
To: | bug-File-Listing [...] rt.cpan.org |
From: | Jo Monterosso <jo.monterosso [...] grantstreet.com> |
File::Listing::dosftp->list cannot handle DIR listings that show the date
as MM-DD-YYYY.
Examples:
Can be handled:
06-23-15 10:12AM <DIR> IN
Cannot be handled:
06-23-2015 10:12AM <DIR> IN
The fix would be in this chunk:
if (($date, $size_or_dir, $name) =
/^(\d\d-\d\d-\d\d\s+\d\d:\d\d\wM) # Date and time info
\s+ # Some space
(<\w{3}>|\d+) # Dir or Size
\s+ # Some more space
(.+)$ # File name
/x )
The above might instead be:
if (($date, $size_or_dir, $name) =
/^(\d\d-\d\d-\d{2,4}s+\d\d:\d\d\wM) # Date and time info
\s+ # Some space
(<\w{3}>|\d+) # Dir or Size
\s+ # Some more space
(.+)$ # File name
/x )
Consider also supporting YYYY-MM-DD.
Regards,
Jo Monterosso
Grant Street Group