SFTP - check free space available

扶醉桌前 提交于 2019-12-08 04:18:08

问题


I'm using Renci SSH.NET library for secure ftp connection. Now I have to check free disk space available on remote SFTP server. How can I do this?


回答1:


As Eugene commented, SFTP protocol version 6 lets one check available space (SSH_FXP_EXTENDED request name space-available).

But Renci SSH.NET library supports SFTP protocol version 3 only. Also worth noting that most SSH/SFTP servers (notably OpenSSH, as the one the most widespread) support SFTP version 3 only too. So client-side support won't help much here.

As Salva has commented, OpenSSH on the other hand supports statvfs@openssh.com proprietary extension. And Renci SSH.NET library supports that too (via SftpClient.GetStatus). So if you are sure that you work against OpenSSH server, you can use that.



来源:https://stackoverflow.com/questions/19769776/sftp-check-free-space-available

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!