Retrieve the security descriptor of the file at *path* on the *service_name*. :param string/unicode service_name: the name of the shared folder for the *path* :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :do
(self, service_name, path, timeout = 30)
| 278 | return results[0] |
| 279 | |
| 280 | def getSecurity(self, service_name, path, timeout = 30): |
| 281 | """ |
| 282 | Retrieve the security descriptor of the file at *path* on the *service_name*. |
| 283 | |
| 284 | :param string/unicode service_name: the name of the shared folder for the *path* |
| 285 | :param string/unicode path: Path of the file on the remote server. If the file cannot be opened for reading, an :doc:`OperationFailure<smb_exceptions>` will be raised. |
| 286 | :return: A :class:`smb.security_descriptors.SecurityDescriptor` instance containing the security information of the file. |
| 287 | """ |
| 288 | if not self.sock: |
| 289 | raise NotConnectedError('Not connected to server') |
| 290 | |
| 291 | results = [ ] |
| 292 | |
| 293 | def cb(info): |
| 294 | self.is_busy = False |
| 295 | results.append(info) |
| 296 | |
| 297 | def eb(failure): |
| 298 | self.is_busy = False |
| 299 | raise failure |
| 300 | |
| 301 | self.is_busy = True |
| 302 | try: |
| 303 | self._getSecurity(service_name, path, cb, eb, timeout) |
| 304 | while self.is_busy: |
| 305 | self._pollForNetBIOSPacket(timeout) |
| 306 | finally: |
| 307 | self.is_busy = False |
| 308 | |
| 309 | return results[0] |
| 310 | |
| 311 | def retrieveFile(self, service_name, path, file_obj, timeout = 30, show_progress = False, tqdm_kwargs = {}): |
| 312 | """ |
nothing calls this directly
no test coverage detected