Recursive directory download with Paramiko?

后端 未结 6 1507
甜味超标
甜味超标 2020-11-30 10:23

I want to download a directory with unknown contents recursively via SSH and have been trying Paramiko. I have seen several examples how to upload directories but none that

6条回答
  •  死守一世寂寞
    2020-11-30 11:22

    stat() method among other attributes returns permissions. d (for example drwxrwxrwx) shows that it is directory.

    As example:

    dir = oct(sftp.stat(path).st_mode)
    print dir[0:2]
    

    output interpritation: 01 fifo 02 character special 04 directory 06 block special 10 regular file 12 symbolic link 14 socket

提交回复
热议问题