Topic "Scripting unix 'find' command, or the like."

Author Message
[View user's profile]

Joined: 2012-10-18
Posts: 1

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.

[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26299
Location: Prague, Czechia
If you choose to use .NET, see Session.ListDirectory

Otherwise see

Note that WinSCP does not provide a function to list files recursively. You need to do that on your own.
Martin Prikryl

You can post new topics in this forum

Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License