Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File::Listing::dosftp->list cannot handle MM-DD-YYYY date formats [rt.cpan.org #105446] #3

Closed
plicease opened this issue Sep 29, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@plicease
Copy link
Member

https://rt.cpan.org/Ticket/Display.html?id=105446

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
@plicease plicease added bug Something isn't working help wanted Extra attention is needed labels Sep 30, 2020
@plicease
Copy link
Member Author

PR with tests are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Development

No branches or pull requests

1 participant