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

Not able to get directory listing for regular FTP to an IBM i (or AS/400 or iSeries) #123

Closed
jkyeung opened this issue Oct 14, 2017 · 8 comments
Labels

Comments

@jkyeung
Copy link

jkyeung commented Oct 14, 2017

I seem to not be able to get a directory listing when connecting to an IBM i server, which is an EBCDIC machine. It appears that I am connected, when I try to read the messages that fly by at the bottom. It even says "125 List started" and "250 List completed" but no list shows up. The more "normal" servers show "226 Transfer complete" when they have displayed the list (successfully).

@cschindl
Copy link
Collaborator

Hi @jkyeung,

can you copy (make a screenshot) the whole ftp log here? You can expand the small ftp log message box. Simply click at the line above of the message appear and resize this block, like resizing a window.

@jkyeung
Copy link
Author

jkyeung commented Oct 16, 2017

Cool, that was easy:

ftp log redacted

@cschindl cschindl added the bug label Oct 19, 2017
@cschindl
Copy link
Collaborator

Your are right, the last command is 250 but it should be 226 to move forward. Very strange?

@jkyeung
Copy link
Author

jkyeung commented Oct 19, 2017

Now that I know the updated way to get debug mode (from #56) I can post the console log, though it doesn't seem to provide much more, if any, information:

console log

I also tried connecting to another IBM i server (pub400.com) and it worked! But it required SFTP, whereas the one I'm having a problem with is FTP.

One interesting thing is that normally, SFTP sessions don't produce any FTP log (is that supposed to be the case?), but when I first successfully connected to PUB400, it did produce an FTP log, and it also ended with 250, yet I saw the files and directories. (I didn't react quick enough to take a snapshot before it filled with NOOP and 200 messages. Maybe we can make the buffer for this log bigger?)

Then I restarted Atom, and now the PUB400 connection is like other SFTP sessions, and doesn't produce an FTP log.

@jkyeung
Copy link
Author

jkyeung commented Oct 20, 2017

I don't really know JavaScript (or CoffeeScript), but just poking around, I noticed that when I try to add some debug statements into the list function in ftp.js, for the sites where the remote browser tree shows up correctly, the list variable prints out as a bunch of comma-separated [object Object]s. But for the server that doesn't bring up the browser tree, the list variable is actually the text of the directory listing!

So a wild guess: The FTP handler on the IBM i is returning the directory listing in a form that is different enough from what "normal" FTP handlers return that it can't be parsed into objects?

Taking a look at the FTP plugin for jEdit (and I don't really know Java either), which works, I see that the directory listing parser includes a code path to handle matches for as400Regexp (AS/400 is an old name for IBM i) . It seems to also have code paths for VMS and DOS (in addition to Unix, of course).

So, I guess one approach would be to try to add code to parse IBM i FTP directory listings. Another possibility is to try to get the IBM i to emit Unix-style directory listings, using the SITE command (SITE LISTFMT 1, in this case).

Like I said, I don't really know what I'm doing, but hopefully this information gets people looking in the right direction. If there is more I can do to help with debugging, I'm willing to try.

@cschindl
Copy link
Collaborator

Hi @jkyeung,

Unfortunately, the used FTP library cannot be modified without much effort so that it would be easier to add code to parse IBM i FTP directory listings. Unfortunately I don't have a test server to make and test the changes.

@jkyeung jkyeung changed the title Not sure, but maybe encoding problem Not able to get directory listing for regular FTP to an IBM i (or AS/400 or iSeries) Oct 21, 2017
cschindl pushed a commit that referenced this issue Nov 6, 2017
@cschindl
Copy link
Collaborator

cschindl commented Nov 6, 2017

Hi @jkyeung,

I have added the SITE command (SITE LISTFMT 1). The changes are available with the new release. It would be great if you could give me some feedback if the problem has been fixed.

@jkyeung
Copy link
Author

jkyeung commented Nov 6, 2017

@cschindl - Hey, it looks like the change works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants