擅长:python、mysql、java
<p>使用<a href="http://docs.paramiko.org/en/2.1/api/sftp.html#paramiko.sftp_client.SFTPClient.stat" rel="noreferrer">^{<cd1>} method</a>:</p>
<pre><code>info = self.sftp.stat(destination)
print info.st_size
</code></pre>
<p><code>.stat()</code>方法遵循符号链接;如果不需要,请使用<code>.lstat()</code>方法。</p>
<p>有关可用的属性,请参见<a href="http://docs.paramiko.org/en/2.1/api/sftp.html#paramiko.sftp_attr.SFTPAttributes" rel="noreferrer">^{<cd4>} class information</a>。<code>.st_size</code>是字节大小。</p>