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

Advertisement

Guest

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

When you try to delete a directory, WinSCP seems to enumerate all files & directories & 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...
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...
du <dir>
...or...
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!").

Reply with quote

Advertisement

Guest

martin 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.

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?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
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.

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.

Reply with quote

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:
---------------------------
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^^
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

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 ;)
(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 :D It isn't easy to use within few minutes...

I'm using WinSCP 4.3.1 beta

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
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:
...
Thanks for your post. This bug has been added to tracker.

Reply with quote

Advertisement

You can post new topics in this forum