Esempio n. 1
0
    def _remove_dir(self, path):
        for root, dirs, files in self.walk(path, topdown=False):
            for fname in files:
                path = posixpath.join(root, fname)
                with ignore_file_not_found():
                    self._remove_file(path)

            for dname in dirs:
                path = posixpath.join(root, dname)
                with ignore_file_not_found():
                    self._sftp.rmdir(dname)

        with ignore_file_not_found():
            self._sftp.rmdir(path)
Esempio n. 2
0
    def st_mode(self, path):
        self._sftp_connect()

        with ignore_file_not_found():
            return self._sftp.stat(path).st_mode

        return 0
Esempio n. 3
0
File: connection.py Progetto: yk/dvc
    def getsize(self, path):
        with ignore_file_not_found():
            return self.sftp.lstat(path).st_size

        return 0
Esempio n. 4
0
 def _remove_file(self, path):
     with ignore_file_not_found():
         self._sftp.remove(path)
Esempio n. 5
0
File: connection.py Progetto: yk/dvc
    def st_mode(self, path):
        with ignore_file_not_found():
            return self.sftp.lstat(path).st_mode

        return 0