sftp_client.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:watchmen 作者: lycclsltt 项目源码 文件源码
def chdir(self, path):
        """
        Change the "current directory" of this SFTP session.  Since SFTP
        doesn't really have the concept of a current working directory, this
        is emulated by paramiko.  Once you use this method to set a working
        directory, all operations on this SFTPClient object will be relative
        to that path. You can pass in C{None} to stop using a current working
        directory.

        @param path: new current working directory
        @type path: str

        @raise IOError: if the requested path doesn't exist on the server

        @since: 1.4
        """
        if path is None:
            self._cwd = None
            return
        if not stat.S_ISDIR(self.stat(path).st_mode):
            raise SFTPError(errno.ENOTDIR, "%s: %s" % (os.strerror(errno.ENOTDIR), path))
        self._cwd = self.normalize(path).encode('utf-8')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号