SFTP - 检查可用空间 [英] SFTP - check free space available
问题描述
我使用 Renci SSH.NET 库进行安全的ftp连接。现在我必须检查远程SFTP服务器上的可用磁盘空间。 Eugene评论说,SFTP协议版本6让我们检查可用空间( SSH_FXP_EXTENDED
请求名称可用空间
)。
但Renci SSH.NET库仅支持SFTP协议版本3。另外值得注意的是,大多数SSH / SFTP服务器(特别是OpenSSH,作为最广泛的一种)也仅支持SFTP版本3。因此,客户端支持在这里帮不了什么忙。
正如Salva评论的,OpenSSH另一方面支持 statvfs@openssh.com
专有扩展。 Renci SSH.NET库也支持这个功能(通过 SftpClient.GetStatus
)。所以如果你确定你对OpenSSH服务器有效,你可以使用它。
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?
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.
这篇关于SFTP - 检查可用空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!