In Sftp.GetList(string)
method (Rebex SFTP), wildcards are applied at the client side because the SFTP protocol doesn't support them. On the other hand, Ftp.GetList(string)
(Rebex FTP) passes the argument to the server without any processing and the caution does in fact apply.
1) Ftp.GetList(string) only supports wildcards if the FTP server supports them. Almost all modern Windows-based and Unix-based FTP servers do, which means you should only be worried if you need a solution that should be compatible with rarer FTP servers as well.
2) Whether the listing is case sensitive depends only on the FTP server. As a general rule, Windows-based FTP servers are case insensitive and Unix-based FTP servers are case sensitive.
If you prefer a compatible solution and custom-defined case (in)sensitivity, cosider using Ftp.GetItems(string) method introduced in the latest vesion (2012 R1) of Rebex FTP, SFTP and File Transfer Pack. This performs the pattern matching at the client side. This might result in slower operation because a full listing is actually transferred to the client, but it's results are not server-dependent. Otherwise it's quite similar to Ftp.GetList(String) To give it a try, use the following code:
using Rebex.Net;
using Rebex.IO;
...
// define a file set of *.txt in the current directory
FileSet fileSet = new FileSet(".", "*.txt", TraversalMode.NonRecursive);
// perform case-sensitive matching
fileSet.IsCaseSensitive = true;
// retrieve the listing
FtpItemCollection list = ftp.GetItems(fileSet);
Note that the FileSet also makes it possible to match multiple patterns at the same time or exclude specific files/patterns from the listing.