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 Answer
As Eugene commented, SFTP protocol actually have an API to check available space (SSH_FXP_EXTENDED
request name space-available
defined in draft-ietf-secsh-filexfer-extensions-00).
But Renci SSH.NET library does not support the extension. Also worth noting that most SSH/SFTP servers (notably OpenSSH, as the one the most widespread) do not support this extension either. So client-side support won't help much here.
As Salva has commented, OpenSSH on the other hand supports [email protected]
proprietary extension with very similar functionality as space-available
. 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.
[email protected]
extension that returns that information.