recursive operations in sftp

Chase Phillips cmp at
Tue Dec 7 14:12:38 EST 2004

Andrew Mortensen wrote:
> If modified fts is required, I'm interested in at least hearing what 
> those modifications would need to be.

Maybe you're not suggesting this, but it's my understanding the best 
path to 'get -r' isn't to change the fts family of functions to receive 
a local call and then traverse a remote directory tree, but instead to 
port the fts family of calls into openbsd-compat and mirror the 'put -r' 
code for 'get -r' commands on the server-side.  (That is, pass the fts 
system calls and arguments down the pipe from sftp to the sftp-server a 
la remote_glob.)

This also has the benefit of giving fts functionality to more platforms. 
  fts didn't work natively on some other OSs (eg RH9) last year.  Has 
the availability of the functions changed in that time to be more widely 

Though I've since lost the revision history (grrr), I have a similar 
'put -r' patch that I stopped working on some time ago.  I agree, it was 
straightforward to implement and the 'get' command is where things 
become tricky.  I will try to dig my patch out of the snapshot I was 
working against at the time and attach it to bug 520.  You may find it 
useful to compare against though I have my doubts that it will apply 
cleanly against a modern snapshot without some leg work.


More information about the openssh-unix-dev mailing list