I need to recursively list the content of a directory that contains a lot of subdirectories (more than 16,000).
I am currently using Paramiko's SFTP client, which doesn't offer any recursive listdir
functionality. So I have to first run listdir
on the parent folder, and then another listdir
for each of the (many, many) subdirectories. It takes too long to run.
Is there any way to run the recursive listdir
in a single SFTP call? I'm not limited to the Paramiko package, it's just the package that we're currently using.
I cannot use Paramiko's ssh.exec_command('ls -R <path>')
due to local administrative restrictions (it would just return an error message).