Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: List of available files to text file

Sorry, I'm not sure what you mean by "directory contents of a specific file". But anyway, whatever it is, it does not look like something that WinSCP can do.

Anyway, since you are using PowerShell, it may be way easier for you to use WinSCP .NET assembly:
https://winscp.net/eng/docs/library
rpeare

List of available files to text file

Hello, I'm hoping there's a simple answer for this.

My current FTP process (which is going to SFTP in the next 3 weeks) has several steps:

1. Retrieves a current directory list of several folders on an FTP site
2. Parses the generated file to find any 'new' files (compares file names against a SQL log)
3. If the file is new I generate a script that will download that file. (second FTP session)
4. Update SQL log with downloaded file name

Is there a way to pipe just the directory contents of a specific file. So let's say I had an SFTP site with the following directories:

\Test1\Dir1
\Test1\Dir2
\Test2\Dir3

With the innate windows FTP.exe the syntax is:

dir /Test1/Dir1 C:\ftp\test1\dir1\CurrentContents.txt
dir /Test1/Dir2 C:\ftp\test1\dir2\CurrentContents.txt
dir /Test2/Dir3 C:\ftp\test2\dir3\CurrentContents.txt

And these can all be run from the same FTP session.

Is there a similar functionality in WINScp?

I'm able to create a single log file that contains what i need but ideally I'd be able to keep the rest of my (powershell) script the same but just modify the batch files that perform the FTP functions.

Thanks
rp