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

Method createDirectory

pager_lib/smb/SMBConnection.py:479–504  ·  view source on GitHub ↗

Creates a new directory *path* on the *service_name*. :param string/unicode service_name: Contains the name of the shared folder. :param string/unicode path: The path of the new folder (relative to) the shared folder. If the path contains

(self, service_name, path, timeout = 30)

Source from the content-addressed store, hash-verified

477 self.is_busy = False
478
479 def createDirectory(self, service_name, path, timeout = 30):
480 """
481 Creates a new directory *path* on the *service_name*.
482
483 :param string/unicode service_name: Contains the name of the shared folder.
484 :param string/unicode path: The path of the new folder (relative to) the shared folder.
485 If the path contains non-English characters, an unicode string must be used to pass in the path.
486 :return: None
487 """
488 if not self.sock:
489 raise NotConnectedError('Not connected to server')
490
491 def cb(r):
492 self.is_busy = False
493
494 def eb(failure):
495 self.is_busy = False
496 raise failure
497
498 self.is_busy = True
499 try:
500 self._createDirectory(service_name, path, cb, eb, timeout = timeout)
501 while self.is_busy:
502 self._pollForNetBIOSPacket(timeout)
503 finally:
504 self.is_busy = False
505
506 def deleteDirectory(self, service_name, path, timeout = 30):
507 """

Callers

nothing calls this directly

Calls 2

_pollForNetBIOSPacketMethod · 0.95
NotConnectedErrorClass · 0.70

Tested by

no test coverage detected