Topic "Why does it take so long to calculate directory size ?"

Author Message
oliverfr
[View user's profile]

Joined: 2013-08-06
Posts: 37
Hello,

On a remote folder that supposedly contains around 15 GB of data, I saw winscp only reaching 50% calculation after 4 minutes had passed.

I don't want to sound too cocky (to the contrary, I'll assume it's simply there must be many factors that I didn't even imagine), but isn't there a way to make it faster ?

FTP commands support advanced listing of a directory contents (LIST, and of course SIZE), which might perhaps be exploited to do a calculation ?

Much better (so : at least, do that for SFTP sessions ?) SFTP commands allow the even more useful "du -lh" command.

Well, this is half a question, half a suggestion, there might be a relatively easy field for improvement, and sorry if it was so complicated this is impossible to implement but I had no idea Wink
oliverfr
[View user's profile]

Joined: 2013-08-06
Posts: 37
A thought just struck me. I have somehow already lived that.
Many years ago, I did the same kind of suggestion in the Filezilla forum (that was before I found that filezilla was storing passwords in a plain text easy to steal file), looking obvious, but that was rejected because it was more complicated that it sounded.

I asked why it took so LONG to delete a directory with hundreds of subdirectories and thousands of files during a SFTP connexion, while a simple "rm -rf *" would automatically do the job in microseconds. And I was answered that Filezilla was an FTP program, so it was sort of cheating to run shell commands instead of FTP commands, even when it was SFTP. Even today, I have yet to understand the reasoning.

But if it's the same conclusion with WinSCP regarding my calculation of directory total size, well, okay.

Anyway, the main point of me answering in my own thread : MERRY HOLIDAYS EVERYONE ! And thank you for the great software Smile
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Thanks for your suggestion.

For FTP: WinSCP IS using LIST command (or modern MLSD) for this purpose.
For SFTP: You CANNOT execute shell commands in SFTP session. WinSCP only seemingly allows you to do that in GUI by opening separate shell session:
https://winscp.net/eng/docs/shell_session
And mainly it works only for *nix servers, so it's not platform-independent.

Quote:
On a remote folder that supposedly contains around 15 GB of data, I saw winscp only reaching 50% calculation after 4 minutes had passed.

It can take long if there are many subdirectories. Was it the case?
Advertisements

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License