Home Forums .NET libraries Xceed SFTP/FTP for .NET NLST instead of LIST for directoy listings

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #20715 |

    I have come across a strange problem that when I call GetFolderContents with a filemask on a certain server, I only ever get 997 records back even though there are more than that there. If I call GetRawFolderContents I get the same thing, only 997 entries. If I try this on another server (windows I think), it works properly. If you want to test it, the server details are as follows:

    Server: ftp://aftp.theimo.com/
    Directory: /pub/reports/PUB/DispUnconsEnergyPrice/
    filemask: *.csv

    The ftp SYST command returns
    215 UNIX Type: L8

    At this time there are 2882 files there with half of those being *.csv the other half *.html

    Using a windows command prompt and using the windows command based ftp program i found that if I use “ls *.csv” I get all csv results as I would expect but “dir *.csv” only returns the same ones as the xceed control. Using a packet sniffer I found that the “ls *.csv” command translates to “NLST *.csv” while the “dir *.csv” becomes “LIST *.csv” which happens to be the command the xceed control is using. So anyway, it seems that this server for some reason does not return correct results from as LIST command when a file mask is used. Is there a way to have the Xceed control use NLST for directory listings?

    I know this is not really Xceed’s fault, but as far as I know this is a fairly large mission critical FTP server and i can’t imagine they are using an obscure FTP server so the issue could well apply to many other UNIX type FTP servers. Any help or sugestions would be much appreciated.

    Eamon

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Eamon (had 3017 views)

    User (Old forums)
    Member
    Post count: 23064

    If you call <b>GetRawFolderContents(true)</b>, NLST will be used. See this page in the documentation: <a href=”http://doc.xceedsoft.com/products/ftpNet/ref/xceed.ftp.ftpclient.getrawfoldercontents_overload_3.html”>http://doc.xceedsoft.com/products/ftpNet/ref/xceed.ftp.ftpclient.getrawfoldercontents_overload_3.html</a&gt;

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Tommy (had 211 views)

    User (Old forums)
    Member
    Post count: 23064

    Thanks Tommy,
    I guess what I was after was a parsed list using NLST but with a bit more research into NLST it wouldn’t help me anyway as I need the last modified dates for the files too.

    I gues my only option is to try to get them to fix whatever problem their sever has or just get all the files and filter on the client side. Didn’t really want to filter client side as it is an extra 150Kb or so to list all the files as opposed to just the *.csv and I need to do it every 3-5 minutes.

    Time to send a email to their help desk.

    Eamon

    Applies to Xceed FTP for .NET. Imported from legacy forums. Posted by Eamon (had 3773 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.