Thue Janus Kristensen
2007-Feb-18 18:48 UTC
SFTP: a new command to get filesystem size/free space
I am using sshfs with FUSE to mount a remote directory over ssh/sftp (on linux). It would be nice if df could be able to show the total size/free space of the mounted directory. I am aware that returning size/free space would have some limitations. For example, if a subdir of the mounted directory has another filesystem mounted on the remote server, this can not be represented simply. However, I still think that a simple implementation could be useful. My idea is to simply return the total size and free space of the current working directory. Would you accept patches implementing this? Please CC me, I am not on this list. Regards, Thue PS: does the openssh sftp implementation conform to http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt ? If not, is the protocol described elsewhere?
Thue Janus Kristensen wrote:> I am using sshfs with FUSE to mount a remote directory over ssh/sftp (on linux). > > It would be nice if df could be able to show the total size/free space > of the mounted directory. > > I am aware that returning size/free space would have some limitations. > For example, if a subdir of the mounted directory has another > filesystem mounted on the remote server, this can not be represented > simply. > > However, I still think that a simple implementation could be useful. > My idea is to simply return the total size and free space of the > current working directory. > > Would you accept patches implementing this?I don't speak for the OpenSSH team but given the history of previous random patches I doubt it will be accepted in any fashion.> > Please CC me, I am not on this list. > > Regards, Thue > > PS: does the openssh sftp implementation conform to > http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt ? If not, > is the protocol described elsewhere?Afaik, yes, OpenSSH supports SFTP version 3, and probably won't support anything else anytime soon. Your feature can probably be easily implemented via the SSH_FXP_EXTENDED message. Though an SSH subsystem for drive metrics might be interesting. -- Jason
On Sun, 18 Feb 2007, Thue Janus Kristensen wrote:> I am using sshfs with FUSE to mount a remote directory over ssh/sftp > (on linux). > > It would be nice if df could be able to show the total size/free space > of the mounted directory. > > I am aware that returning size/free space would have some limitations. > For example, if a subdir of the mounted directory has another > filesystem mounted on the remote server, this can not be represented > simply. > > However, I still think that a simple implementation could be useful. > My idea is to simply return the total size and free space of the > current working directory. > > Would you accept patches implementing this?We would consider them, sure - but we can't promise we will like them enough to accept them before we see them :) The patch would have the best chance of being accepted if it used the SSH2_FXP_EXTENDED protocol message and followed the message format of later filexfer drafts for the encoding of filesystem information (IIRC recent filexfer drafts have a statvfs-like method). The patch would also need to implement support for it in the sftp client, so we can have a way to test the method in our regress tests.> PS: does the openssh sftp implementation conform to > http://www.openssh.org/txt/draft-ietf-secsh-filexfer-02.txt ? If not, > is the protocol described elsewhere?IIRC we actually implement filexfer-03, but the draft for it seems to have fallen off the net. -d
Possibly Parallel Threads
- [Bug 16530] New: Full screen is broken when using multiple monitors
- [Bug 1286] SFTP keeps reading input until it runs out of buffer space
- [SFTP] Read from write-only file not returning error
- sftp-server failing to rename a file
- FW: filexfer draft and uid / gid resolution ...