GetFiles and LIST/NLST - WeOnlyDo Discussion board

GetFiles and LIST/NLST (wodSFTP / wodSFTP.NET / wodSFTPdll)

by sauerc, Wednesday, August 12, 2009, 16:26 (5583 days ago)


Hello,

We use wodFtpDLX as part of an automated process to log into FTP or SFTP servers from clients and grab files for processing. Since the number of files and filename format varies client to client, we use GetFiles with LoopItem to grab the right ones. We've been doing this for years with no issues.

We recently setup the process for a new client and it's not working. When we call GetFiles it immediately fires the Done event. I logged into their server using an FTP client and have discovered that when you issue a LIST command it returns nothing but the NLST command will return the contents of the directory.

Does GetFiles use LIST internally? If so, is there a way to force it to use NLST? If not, is there something else we can do?

We're using version 2.6.3.275 according to the version tab on the DLL's properties.

Re: GetFiles and LIST/NLST

by wodDamir, Wednesday, August 12, 2009, 19:23 (5583 days ago) @ sauerc

Hi,

Are you 100 sure that LIST doesn't retrieve anything? NLST command will only return names of folders/files.

If that's what you really need, you should try using ListNames method (instead of ListDir) which sends NLST by default.

Can you try that?

Regards,
Damba

Re: GetFiles and LIST/NLST

by sauerc, Wednesday, August 12, 2009, 19:33 (5583 days ago) @ wodDamir


Are you 100 sure that LIST doesn't retrieve anything? NLST command will only return names of folders/files.

Yes, I did a ftp -d from a windows machine, when the ftp client sends LIST (dir from windows ftp) you get nothing but when the ftp client sends NLST (ls from windows ftp) you get the directory listing back. It's very strange. I've asked what server software they are using since I've never seen this behavior before.


If that's what you really need, you should try using ListNames method (instead of ListDir) which sends NLST by default.

Can you try that?

I'm not using ListNames or ListDir. We call Connect and then GetFiles. With a non-broken server, after we call GetFiles we immediately go into the LoopItem event for every item found in the directory and then go into the Done event. With this broken server the call to GetFiles immediately goes to the Done event, as if it can't see any files.

Re: GetFiles and LIST/NLST

by wodDamir, Wednesday, August 12, 2009, 20:06 (5583 days ago) @ sauerc

Hi,

Is there any chance you could perhaps update the component to the latest version, since the one you are using is from 2006?

Can you try setting ListParams property to before connecting?

If that doesn't help, perhaps using PreTranslateCommand event to change command from LIST to NLST when GetFiles is called would help?

Can you try those?

Regards,
Damba

Re: GetFiles and LIST/NLST

by sauerc, Wednesday, August 12, 2009, 21:31 (5583 days ago) @ wodDamir


Is there any chance you could perhaps update the component to the latest version, since the one you are using is from 2006?

This did not solve the issue.


Can you try setting ListParams property to before connecting?

This also did not solve the issue.


If that doesn't help, perhaps using PreTranslateCommand event to change command from LIST to NLST when GetFiles is called would help?

This worked! We're going to add a configuration setting so that we only have to do this for this one client.

Thanks a lot!