-
-
Notifications
You must be signed in to change notification settings - Fork 656
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
Implement 'rules' or 'wildcards' in GetListing #1246
Comments
Rules are a good idea, but keep in mind server will not do it. We do it on client side. |
Hi! Thanks for answering so soon. |
I would like to chime in here, if I may. RFC 959 (purposely?) does not go into any detail at all about the inferred meaning of filepath, pathname etc. when it describes the function of the LIST, RETR etc. etc. commands that take such a parameter. Thus, in the past, different FTP (RFC 959) server implementations have taken various liberties in implementing wildcards, and to which degree. The wildcard functionality that you can achieve today, currently depends entirely on the server that you are connecting to. Here is an example, using an up-to-date ProFTPD server. client.Connect();
var item = client.GetListing("*.bin");
client.Disconnect();
As you can see, on this server type, But: If you code var item = client.GetListing("*.bin", FtpListOption.ForceList); you will get:
and the list items are populated correctly. Therefore, I don't totally understand what you are asking for. Wildcards work, when the server supports them. You just need to find the right way to code it, and do some experiments to see what works and what does not. If your wish is to support wildcards client-side, i.e. for servers that do not support them, then okay, that is a possibly valid enhancement request, although you can easily handle that in your own code. |
Once more this is a good example why adding some example code and log output to show what you are trying to do, would have been a good idea, to save some time in speculation.
It doesn't need to. The server does it. You just need to read up on GetListing and find out how to ask it to do the right thing. |
HI FanDjango. Thanks for your answer. As first parameter in GetListing is path, I didn't think it was possible to add a wildcard. My aim is to populate a treview node with the pdfs in a given path basically my code is ... (visual basic) **Private Sub Populate(node As TreeNode, path As String)
and that is working fine After your answer, I've tried ...
but then I get nothing. Just in case, I've also tried ...
getting nothing again So far, I've started to believe my server doesn't allow wildcards. |
A log excerpt would tell us why...
The answer of the server, the command selected by FluentFTP? Note that some servers don't even like a path, you might need to go to the working directory first, and then do a listing using only the wildcard filespec + FtpListOption.NoPath as well. So your second try needs: |
In a (complete) log, we could also see the result of the |
If all else fails, your VBasic loop to select the right files is nothing other than what we would also do - so there is no real advantage in coding this inside |
I've made a trial console app and use the Config.LogToConsole = true option. I ended up acknowledging that I can't do the filtering at server side. I'll settle doing it at client side. I've actually appreciate your kind support. Thank you so much. |
What about |
I have moved this to the Wiki: here |
As I said before. |
Thanks for your answer @FanDjango , added to FAQ - https://github.com/robinrodricks/FluentFTP/wiki/Directory-Listing#can-i-filter-file-listings-using-wildcards |
FTP Server OS: Unix
FTP Server Type: hidrive.strato.com
Client Computer OS: Windows
FluentFTP Version: 46.02
Framework: 8.1 (I would have liked to run it under versión 4.0 or 4.5)
I'm new to github so I apologize if this is not the right way to do this.
It would be very useful to me if GetListing also had the posibility of Rules likewise DownloadDirectory or at least the posibility of using wildcards.
Of course I can filter it once I get the file listing but it could be more efficient if the server do it.
I wonder if there is any way of doing this or if it could be possible to implement it in a (not very) future versión.
Thanks in advance for your answer
Logs :
The text was updated successfully, but these errors were encountered: