1
我想检查一个远程文件是否可写或使用paramiko。 我当前的代码是如何使用python Paramiko(SSHClient)检查远程文件是否可写?
from paramiko.ssh_exception import SSHException, BadHostKeyException
import paramiko
import sys
from optparse import OptionParser
import os
stdin, stdout, stderr = self.__econnection.exec_command('bash');
stdin.write('if [ -w "%s" ];'%(temp_path))
stdin.write("then echo True;");
stdin.write("else echo False;");
stdin.write("fi;");
stdin.flush();
但是一旦我执行这些方针,外壳只是卡住,我不得不关闭外壳。 请帮助..
做一个简单的'ls'工作? – 2011-02-24 09:33:19
yes ls正常工作 – tejzpr 2011-02-24 09:38:26
请写下你的'import',以便我们查看它的文档。 – 2011-02-24 10:31:23