Posted: 2012-10-18 20:52
Before I get to my question, I'll provide some context. I'm looking to write a program for Windows (preferably in Java, but if it's possible using the WinSCP .NET framework, I am not opposed to using VB.NET or C#) that provides a list of files in its UI which reside on a remote Unix server that match a specific string pattern - such as EXAMPLE.TXT or EXAM* - and which may be several directories deep from the current working directory. Because of this last requirement, 'ls' will not work.
I know how to script the copies themselves, but gathering a list of files from the remote server and placing it into the program's UI so that a user may elect whether to copy them is confusing me. I don't want to actually show the directory structure, such as you see in the WinSCP interface, but rather I simply want to show a list of the absolute paths with filenemes of those files that match the string pattern. Once I have the list, the rest of the coding that allows the user to manipulate it should be trivial.
I have performed searches in the documentation and the forums for a command similar to Unix's 'find' that can return a list of files in the the current directory itself, or further into the directory structure. However, I have so far been unable to find something that would allow me to write a program with a UI for Windows.
Any insight anyone may have into this would be greatly appreciated.
Location: Prague, Czechia
If you choose to use .NET, see Session.ListDirectory
Note that WinSCP does not provide a function to list files recursively. You need to do that on your own.
You can post new topics in this forum
And it's free!