Topic "SFTP: Some operations are unnecessarily slow (del/calc dir)"

Author Message
Guest




When you try to delete a dir, WinSCP seems to enumerate all files & dirs & delete them 1-at-a-time. Now, this may be the "only way" if the user only has SFTP access (it may be a protocol limitation). But I have SSH/SFTP access, so removing a dir takes like 1 second with...

Code:
rm -r <dir>

...but could take awhile, since WinSCP enumerates & then deletes all files/dirs 1-at-a-time. We don't know the protocol limitations...could you specify how this is handled in different protocols?...& look for faster methods in each?

Ditto for Right-click -> Properties -> Calculate...it enumerates all files, adding up the size. But a simple...

Code:
du <dir>

...or...

Code:
du -h <dir>

...will tell the size of a dir, in a few seconds, for those that have full-SSH access.

I understand some people have limited, bare bones, SFTP access...no SSH, no command line, but for those that do, it would help to speed up these commands.

Maybe you could auto-detect if it "will work" on a server (try & let it fail...or something else)...or add a checkbox to the sessions options ("My SFTP account can do SSH commands too!").
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
You can use SCP instead:
https://winscp.net/eng/docs/protocols

Or use custom commands for expensive operations:
https://winscp.net/eng/docs/custom_command
_________________
Martin Prikryl
Guest




prikryl wrote:
You can use SCP instead

...OK, but I thought SFTP was newer/more secure than SCP? I only mentioned SFTP specifically, cuz I haven't tested how WinSCP "does it" in other protocols.

prikryl wrote:
Or use custom commands for expensive operations

...OK, so does that mean optimizing normal delete/operations is not a TODO? I actually didn't think of using Custom Commands for this, but also it would be better to optimize the standard delete. Also, (I should test but) how would I see the output of du in the Properties/Calculate dialog?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Anonymous wrote:
...OK, but I thought SFTP was newer/more secure than SCP? I only mentioned SFTP specifically, cuz I haven't tested how WinSCP "does it" in other protocols.

It is, but it just cannot do what you ask for.
SCP can hardly be called a protocol.

prikryl wrote:
Also, (I should test but) how would I see the output of du in the Properties/Calculate dialog?

No. You can see it in Console window.
_________________
Martin Prikryl
WhiteTiger

Guest


+1 for SFTP to support some faster shell commands. (using Custom Commands is a way yes, but it's easier when WinSCP uses them as default for delete and size infos etc.)

I've also found a bug when using SCP, when I try to change the owner/group of any folder recursively and set all permissions to not change at all, I get this one:
Code:
---------------------------
Error
---------------------------
Cannot change properties of file 'wt_ts'.
---------------------------
Command 'chmod -R  "wt_ts"'
failed with return code 1 and error message
chmod: missing operand after `wt_ts'
Try `chmod --help' for more information..
---------------------------
Abort   Retry   Skip   Skip all   Help   
---------------------------
where "wt_ts" is a folder: "/home/wt_ts" and the owner/group was set to "root".
So i don't know why WinSCP does this.. since the owner/group is missing there but anyway... except this error message, everything seems to work. (so successfully changed owner and group to root^^)

Even with SCP do I use this Custom Command to be on the safe side^^
Code:
chown -R "!?prompt?www-data!:!?prompt?www-data!" "!"


in my eyes, WinSCP has to change many little things to get more user friendly. eg. when using SFTP also use the Shell when available to speed up things or even easier change permissions because you can enter any User/Group by name and do not need to know their number/id
when using SCP (my choice for now) allow more things like Calculate checksums like for SFTP using md5sum and other Shell commands ( http://linux.byexamples.com/archives/198/md5-checksum-how-to/ )

And yes.. I understood the problem using shell commands... their output isn't always the same especially for other languages, but regular expressions can help a lot Wink (in worst case: the community will help out i believe, so they will "translate" them)

PS: I can offer you my service to help to improve WinSCP... but for that one i have to understand your source Very Happy It isn't easy to use within few minutes...
WhiteTiger

Guest


damn^^ i should register on this forum since i like to edit my posts Very Happy
forgot to mention that I'm using WinSCP 4.3.1 beta (i always use the newest one Wink)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
WhiteTiger wrote:
I've also found a bug when using SCP, when I try to change the owner/group of any folder recursively and set all permissions to not change at all, I get this one:
Code:
---------------------------
Error
---------------------------
Cannot change properties of file 'wt_ts'.
---------------------------
Command 'chmod -R  "wt_ts"'
failed with return code 1 and error message
chmod: missing operand after `wt_ts'
Try `chmod --help' for more information..
---------------------------
Abort   Retry   Skip   Skip all   Help   
---------------------------
where "wt_ts" is a folder: "/home/wt_ts" and the owner/group was set to "root".
So i don't know why WinSCP does this.. since the owner/group is missing there but anyway... except this error message, everything seems to work. (so successfully changed owner and group to root^^)

Thanks for your post. This bug has been added to tracker.
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