One of my client’s ftp server recently moved from Linux to Windows.
Searching using *.[cC][sS][vV]
looks for *.csv and *.CSV files as intended on Linux.
But this doesn’t work on Windows. Is there a way to expand this correctly on Windows or perform a case-insensitive search on Windows ftp server?
Advertisement
Answer
The FTP specification does not allow any filemasks.
While some FTP servers do support this, you cannot rely on this functionality, if your script has to be platform-independent.
The Windows IIS FTP server does not support file masks. Even if it did, it would not support the set syntax ([]
), as that’s not supported in Windows file masks in general.
See also Get File Listing ending with A or B using Jscape FTP.
You have to retrieve all files (without any mask) and filter them locally in your code/script.