MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / deleteFiles

Method deleteFiles

pager_lib/smb/SMBProtocol.py:306–324  ·  view source on GitHub ↗

Delete one or more regular files. It supports the use of wildcards in file names, allowing for deletion of multiple files in a single request. If delete_matching_folders is True, immediate sub-folders that match the path_file_pattern will be deleted recursively. :p

(self, service_name, path_file_pattern, delete_matching_folders = False, timeout = 30)

Source from the content-addressed store, hash-verified

304 return d
305
306 def deleteFiles(self, service_name, path_file_pattern, delete_matching_folders = False, timeout = 30):
307 """
308 Delete one or more regular files. It supports the use of wildcards in file names, allowing for deletion of multiple files in a single request.
309
310 If delete_matching_folders is True, immediate sub-folders that match the path_file_pattern will be deleted recursively.
311
312 :param string/unicode service_name: Contains the name of the shared folder.
313 :param string/unicode path_file_pattern: The pathname of the file(s) to be deleted, relative to the service_name.
314 Wildcards may be used in th filename component of the path.
315 If your path/filename contains non-English characters, you must pass in an unicode string.
316 :param integer/float timeout: Number of seconds that pysmb will wait before raising *SMBTimeout* via the returned *Deferred* instance's *errback* method.
317 :return: A *twisted.internet.defer.Deferred* instance. The callback function will be called with the *path_file_pattern* parameter.
318 """
319 if not self.instance:
320 raise NotConnectedError('Not connected to server')
321
322 d = defer.Deferred()
323 self.instance._deleteFiles(service_name, path_file_pattern, delete_matching_folders, d.callback, d.errback, timeout = timeout)
324 return d
325
326 def createDirectory(self, service_name, path):
327 """

Callers

nothing calls this directly

Calls 1

NotConnectedErrorClass · 0.70

Tested by

no test coverage detected