Commons Net
  1. Commons Net
  2. NET-339

Incorrect parsing of timestamp on Windows CE

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.2
    • Component/s: FTP
    • Labels:
      None
    • Environment:

      Windows

      Description

      Somewhere in the past the timestamp format returned by windows/the windows ftp server changed.

      In the past the timestamp had a format like: '09-21-10 06:00PM'.
      The 'current' format however is: '09-21-10 18:00'.

      In version 1.4 this resulted in no files being displayed because parsing the timestamp fails;
      In version 2 this results in the files being displayed but without the timestamp.

      (This is the result of change 645299)

      The attached patch updates the code so that it detects both the old and the new format of the timestamp.

      A bug that also mentions this, or at least the comments, https://issues.apache.org/jira/browse/NET-50

        Activity

        Hide
        Sebb added a comment -

        Thanks for the patch.
        Unfortunately it does not work properly for older dates such as '05-22-97 12:08' - they are treated as being in the current year (2010).

        I think this is because the format is being used as the recentDateFormat, rather than an alternative full date format.

        Show
        Sebb added a comment - Thanks for the patch. Unfortunately it does not work properly for older dates such as '05-22-97 12:08' - they are treated as being in the current year (2010). I think this is because the format is being used as the recentDateFormat, rather than an alternative full date format.
        Hide
        Bram added a comment -

        Thanks for pointing out that it does not work correctly for dates created in another year... (I only tested dates in 2010...)

        Attached is a new patch which first tries the new format ('09-21-10 18:00') and then the old format ('09-21-10 06:00PM').

        (I'm not sure this is the right solution though.. maybe it needs a more general solution?)

        Show
        Bram added a comment - Thanks for pointing out that it does not work correctly for dates created in another year... (I only tested dates in 2010...) Attached is a new patch which first tries the new format ('09-21-10 18:00') and then the old format ('09-21-10 06:00PM'). (I'm not sure this is the right solution though.. maybe it needs a more general solution?)
        Hide
        Bram added a comment -

        v2 of the patch

        Show
        Bram added a comment - v2 of the patch
        Hide
        Sebb added a comment -

        Thanks, v2 appears to work with the test data we have.

        Are there any public FTP servers running the new version of Windows server that you know about?

        Show
        Sebb added a comment - Thanks, v2 appears to work with the test data we have. Are there any public FTP servers running the new version of Windows server that you know about?
        Hide
        Bram added a comment -

        I'm not aware of any public FTP servers...

        (Note: this was seen on Windows CE, Windows XP uses the 'old' format; other versions of Windows are untested/unknown)

        Show
        Bram added a comment - I'm not aware of any public FTP servers... (Note: this was seen on Windows CE, Windows XP uses the 'old' format; other versions of Windows are untested/unknown)
        Hide
        Sebb added a comment -

        OK, perhaps you can provide some more examples then?

        Also, what does the SYST command return?
        (Probably need to use "quote SYST" to send the command interactively)
        Likewise the output of the STAT command would be useful, and the banner details, for example as shown in the line prefixed with 220 below:

        $ ftp -A ftp.mirrorservice.org
        Connected to ftp.mirrorservice.org.
        220 UK Mirror Service FTP server version 1.4 ready
        ftp> quote SYST
        215 UNIX Type: L8
        ftp> quote STAT
        211- maxwell-if-a.mirrorservice.org FTP server status:
        211- Caching FTP server Version 1.4
        211- Connected to n.n.n.n
        211- Logged in anonymously
        211- TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: Stream
        211 No data connection

        Show
        Sebb added a comment - OK, perhaps you can provide some more examples then? Also, what does the SYST command return? (Probably need to use "quote SYST" to send the command interactively) Likewise the output of the STAT command would be useful, and the banner details, for example as shown in the line prefixed with 220 below: $ ftp -A ftp.mirrorservice.org Connected to ftp.mirrorservice.org. 220 UK Mirror Service FTP server version 1.4 ready ftp> quote SYST 215 UNIX Type: L8 ftp> quote STAT 211- maxwell-if-a.mirrorservice.org FTP server status: 211- Caching FTP server Version 1.4 211- Connected to n.n.n.n 211- Logged in anonymously 211- TYPE: ASCII, FORM: Nonprint; STRUcture: File; transfer MODE: Stream 211 No data connection
        Hide
        Bram added a comment -

        the ftp servers does not seem to support the stat command...

        ftp> open n.n.n.n
        Connected to n.n.n.n.
        220 Service ready for new user.
        Name (n.n.n.n:root): admin
        331 User name okay, need password.
        Password:
        230 User logged in, proceed.
        Remote system type is Windows_CE.
        ftp> quote syst
        215 Windows_CE version 6.0.
        ftp> dir
        229 Entering extended passive mode (|||53321|).
        125 Data connection already open; transfer starting.
        01-01-98 05:00 <DIR> Network
        01-01-98 05:00 <DIR> StorageCard
        09-13-10 20:08 <DIR> Recycled
        09-06-06 19:00 69 desktop.ini
        09-13-10 13:08 23 Control Panel.lnk
        09-13-10 13:08 <DIR> My Documents
        09-13-10 13:08 <DIR> Program Files
        09-13-10 13:08 <DIR> Temp
        09-13-10 13:08 <DIR> Windows
        226 Closing data connection.
        ftp> quote stat
        500 Syntax error, command unrecognized.
        ftp> quote help
        214-The following commands are implemented.
        USER PASS QUIT PORT PASV
        TYPE RETR STOR RNFR RNTO
        DELE CWD XCWD LIST NLST
        SYST HELP NOOP MKD XMKD
        RMD XRMD PWD XPWD CDUP
        XCUP MODE STRU

        214 HELP command successful.

        Show
        Bram added a comment - the ftp servers does not seem to support the stat command... ftp> open n.n.n.n Connected to n.n.n.n. 220 Service ready for new user. Name (n.n.n.n:root): admin 331 User name okay, need password. Password: 230 User logged in, proceed. Remote system type is Windows_CE. ftp> quote syst 215 Windows_CE version 6.0. ftp> dir 229 Entering extended passive mode (|||53321|). 125 Data connection already open; transfer starting. 01-01-98 05:00 <DIR> Network 01-01-98 05:00 <DIR> StorageCard 09-13-10 20:08 <DIR> Recycled 09-06-06 19:00 69 desktop.ini 09-13-10 13:08 23 Control Panel.lnk 09-13-10 13:08 <DIR> My Documents 09-13-10 13:08 <DIR> Program Files 09-13-10 13:08 <DIR> Temp 09-13-10 13:08 <DIR> Windows 226 Closing data connection. ftp> quote stat 500 Syntax error, command unrecognized. ftp> quote help 214-The following commands are implemented. USER PASS QUIT PORT PASV TYPE RETR STOR RNFR RNTO DELE CWD XCWD LIST NLST SYST HELP NOOP MKD XMKD RMD XRMD PWD XPWD CDUP XCUP MODE STRU 214 HELP command successful.
        Hide
        Sebb added a comment -

        Thanks.

        I wonder now whether Windows CE should be treated as a different OS from Windows, and reserve the new format for that.

        Or have you encountered other ordinary Windows (not CE) FTP servers that return times using the 24hr clock?

        Show
        Sebb added a comment - Thanks. I wonder now whether Windows CE should be treated as a different OS from Windows, and reserve the new format for that. Or have you encountered other ordinary Windows (not CE) FTP servers that return times using the 24hr clock?
        Hide
        Bram added a comment -

        I haven't encountered it on other systems (yet) but that does not mean anything...

        (This is a not frequently used part of a not frequently used feature of our product...)

        Show
        Bram added a comment - I haven't encountered it on other systems (yet) but that does not mean anything... (This is a not frequently used part of a not frequently used feature of our product...)

          People

          • Assignee:
            Unassigned
            Reporter:
            Bram
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development