You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Colin Stone (JIRA)" <ji...@apache.org> on 2011/03/17 12:01:29 UTC

[jira] Created: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

setListHiddenFiles doesn't work for HFS file system running under zos
---------------------------------------------------------------------

                 Key: NET-376
                 URL: https://issues.apache.org/jira/browse/NET-376
             Project: Commons Net
          Issue Type: Bug
          Components: FTP
    Affects Versions: 2.2
         Environment: IBM z/OS running HFS
            Reporter: Colin Stone


The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sebb resolved NET-376.
----------------------

    Resolution: Not A Problem

Not sure there's much to be done here now

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13009541#comment-13009541 ] 

Sebb commented on NET-376:
--------------------------

MSLD and MLST have now been added.

However, testing shows that support is not universal, and even where they are supported, the "facts" (i.e. size, perms etc) vary a lot, and rarely return as much information as a LIST listing. Rather disappointing, but I suppose support will improve.

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Colin Stone (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007953#comment-13007953 ] 

Colin Stone commented on NET-376:
---------------------------------

As you would expect really. 
LIST 
125 List started OK
250 List completed successfully.
when set to false
LIST -a 
125 List started OK
250 List completed successfully.
when set to true

The issue is in the format or the returned rows and how the parser reads them. In the first LIST presents the data in the way I would expect LIST -l to do (even though the -l parameter is not present) and the parser sees all of the detail including user, group, permissions etc. The LIST -a simply presents the file name and the UnixFTPEntryParser rejects each entry as they doesn't match on the regexps.


> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007961#comment-13007961 ] 

Sebb commented on NET-376:
--------------------------

At some point I'm hoping to implement MLST and MLSD [1] which should avoid any parsing issues for servers that support them.

[1] http://tools.ietf.org/html/rfc3659#section-7

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007940#comment-13007940 ] 

Sebb commented on NET-376:
--------------------------

Can you try adding the following before calling initiateListParsing?

anFTPClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

This will show the commands that are being sent and the responses.

[BTW, you could update your code to add a call to display the output from getReplyString() if the command fails.]

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Colin Stone (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007959#comment-13007959 ] 

Colin Stone commented on NET-376:
---------------------------------

Thanks Sebb. 
I'll prod some of the guys here to try and find out if there are any peculiarities with regards to the FTP installation we have. I'm reasonably happy with the workaround being employed but will feed back to you anything that's appropriate or worth documenting further.
Many thanks for your time.


> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007907#comment-13007907 ] 

Sebb commented on NET-376:
--------------------------

Can you provide sample listings for -a and -al? It might be possible to improve the parsing.

Do you know of a publicly accessible server running the relevant file system?

FTP servers support two different list commands: LIST and NLST. LIST corresponds generally with "-l".

So I think "-a" is correct.



> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Colin Stone (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007918#comment-13007918 ] 

Colin Stone commented on NET-376:
---------------------------------

Some sort of failure. The socket comes back as null in FTPClient

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007957#comment-13007957 ] 

Sebb commented on NET-376:
--------------------------

Most (all?) FTP servers I have used always return the full format when LIST is used, and names only when NLST is used.

It seems like a bug that the LIST format depends on whether the -a flag is present or not - however the RFCs don't cover this as far as I can tell.

==

I have since found that ftp servers generally don't like it if the LIST command contains a trailing space but no pathname.
This is probably the cause of the null socket - adding the command listener should show that.

The FTP code allows for null pathname, treating it as a missing parameter.
It assumes that an empty pathname is valid, and prepends a space when constructing the command. 
Changing that might break user code, so at present I'm inclined to just document the behaviour.

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Colin Stone (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007914#comment-13007914 ] 

Colin Stone commented on NET-376:
---------------------------------

Thanks for the response. 

The code has been implemented as follows:
 
FTPListParseEngine parseEngine = anFTPClient.initiateListParsing(parserType, arguments);
where parserType is UnixFTPEntryParser. 

When I look into the results contained within the parse engine (with no setHidden..) it looks like the output from a ls -l:
drwxr-xr-x   2 MYUSER1  TSOUSER      608 Mar 16 18:25 test1

By changing the arguments to -al I get 
drwx------      3 MYUSER1  TSOUSER      320 Mar 16 18:25 .
dr-xr-xr-x  14667 NETVIEW  TTY            0 Mar 17 13:53 ..
drwxr-xr-x      2 MYUSER1  TSOUSER      608 Mar 16 18:25 test1 
which is exactly what I wanted.

However when I run the code with no arguments but the setListHiddenFiles set to true on the FTPClient, I get no files returned and the parse engine seems to have entries corresponding to:
ftp> ls -a
200 Port request OK.
125 List started OK
.
..
test1

And the parse engine does not interpret them.

As you can see I have already applied a workaround that is acceptable for our requirements, simply by passing the arguments. It is possible that we have an unusual server FTP setup which may be missing something configuration wise, so we may just have an extreme edge condition but worth logging I thought. Sorry I can't help on the publically available front.

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] Commented: (NET-376) setListHiddenFiles doesn't work for HFS file system running under zos

Posted by "Sebb (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/NET-376?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13007916#comment-13007916 ] 

Sebb commented on NET-376:
--------------------------

What happens if you run the code with setListHiddenFiles and an argument - e.g. "*" ?

The code that adds the -a also adds a trailing space, even if there is no argument - that might be causing the problem.

> setListHiddenFiles doesn't work for HFS file system running under zos
> ---------------------------------------------------------------------
>
>                 Key: NET-376
>                 URL: https://issues.apache.org/jira/browse/NET-376
>             Project: Commons Net
>          Issue Type: Bug
>          Components: FTP
>    Affects Versions: 2.2
>         Environment: IBM z/OS running HFS
>            Reporter: Colin Stone
>
> The implementation for setListHiddenFiles is essentially the use of a '-a' parameter appended to the LIST command. This retrieves the data in a different format to without the parameter and the parse engine used by initiateListParsing fails to read the lines returned. 
> I suggest the parameter should have been '-al' for this scenario

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira