Skip remote directory listing

Advertisement

lurker
Joined:
Posts:
2

Skip remote directory listing

Hi!

I'm using script to upload files, it looks like this:
open ftp://.....
option confirm off
put "D:\test.txt" /test.txt
exit
So nothing special here, just connect and upload file.
The problem is that WinSCP always executes LIST command before file upload.
Remote directory contains 70000+ files and my download speed with that server is very low (but upload is very fast).
So in order to upload 1 tiny file my script have to wait for a few minutes to get the unnecessary directory listing.

Is there any way to skip that step?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: Skip remote directory listing

Make sure you are using the latest version of WinSCP.

If you are already, and still get this behavior, please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=path_to_log_file command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

sdt99
Joined:
Posts:
3
Location:
USA

I am having same problem (WinSCP, Version 5.15.9 (Build 10071))

I want to upload / download files using FTPS – I don't want overwrite warnings – just transfer the files. I'm using a script like this:
open ftps://.....
option confirm off
get filename1.txt
put filename2.txt
exit
There are over 1 million files in the FTP root – I would like to disable the directory listing but I don't know how to do this.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: I am having same problem (WinSCP, Version 5.15.9 (Build 10071))

@sdt99: Please attach a full session log file showing the problem (using the latest version of WinSCP).

To generate the session log file, use /log=C:\path\to\winscp.log command-line argument. Submit the log with your post as an attachment. Note that passwords and passphrases not stored in the log. You may want to remove other data you consider sensitive though, such as host names, IP addresses, account names or file names (unless they are relevant to the problem). If you do not want to post the log publicly, you can mark the attachment as private.

Reply with quote

Advertisement

sdt99
Joined:
Posts:
3
Location:
USA

Log files

Here is the script:
open ftps://<username>:<password>@172.30.19.21/ -explicit
option confirm off
get ws_bdy.txt
put 000001000001.cfs
exit
I have attached log files for two cases – one where the directory listing has been disabled at the FTP server (the file download works fine) and another where directory listing has been enabled at the server. I had to kick the user and truncate the log otherwise there would have been millions of files listed. I think you can still see the difference between the logs - in both cases winscp is sending the MLSD command (which I don't want and would like to disable).

Reply with quote

martin
Site Admin
martin avatar

Re: Log files

I have sent you an email with a debug version of WinSCP to the address you have used to register on this forum.

Reply with quote

Ken Rokos
Joined:
Posts:
1
Location:
Los Angeles

Any updates on this?

I just started using EnumerateRemoteFiles and it shows the listing twice in the WinSCP log (set using $session.SessionLogPath = 'C:\WinSCPLog.txt'). It would be nice to suppress this in the log so I don't have a huge log every time I run this.
$InvFiles = $session.EnumerateRemoteFiles($SourcePath, 'INV*.dat', [WinSCP.EnumerationOptions]::None)
There are only a few INV files in the directory.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,276
Location:
Prague, Czechia

Re: Any updates on this?

@KenRokos: This is not what this thread is about.
Anyway, did you try to enable reduced logging?
$session.AddRawConfiguration("Logging\LogProtocol", "-1")

Reply with quote

Advertisement

You can post new topics in this forum