Update docs
Michael Teo
10 years ago
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
Binary diff not shown
0 | 0 | # Sphinx build info version 1 |
1 | 1 | # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. |
2 | config: c707d5f0c2f3122707ecae391b521805 | |
2 | config: f12178f8fe0cf450bc418892f72f8298 | |
3 | 3 | tags: fbb0d17656682115ca4d033fb2f83ba1 |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>Overview: module code — pysmb 1.0.0 documentation</title> | |
10 | <title>Overview: module code — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | </head> |
29 | 29 | <body> |
30 | 30 | <div class="related"> |
33 | 33 | <li class="right" style="margin-right: 10px"> |
34 | 34 | <a href="../genindex.html" title="General Index" |
35 | 35 | accesskey="I">index</a></li> |
36 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
36 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
37 | 37 | </ul> |
38 | 38 | </div> |
39 | 39 | <div class="sphinxsidebar"> |
79 | 79 | <li class="right" style="margin-right: 10px"> |
80 | 80 | <a href="../genindex.html" title="General Index" |
81 | 81 | >index</a></li> |
82 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
82 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
83 | 83 | </ul> |
84 | 84 | </div> |
85 | 85 | <div class="footer"> |
86 | © Copyright 2011, Michael Teo. | |
86 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
87 | 87 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
88 | 88 | </div> |
89 | 89 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>nmb.NetBIOS — pysmb 1.0.0 documentation</title> | |
10 | <title>nmb.NetBIOS — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
161 | 161 | <li class="right" style="margin-right: 10px"> |
162 | 162 | <a href="../../genindex.html" title="General Index" |
163 | 163 | >index</a></li> |
164 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
164 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
165 | 165 | <li><a href="../index.html" >Module code</a> »</li> |
166 | 166 | </ul> |
167 | 167 | </div> |
168 | 168 | <div class="footer"> |
169 | © Copyright 2011, Michael Teo. | |
169 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
170 | 170 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
171 | 171 | </div> |
172 | 172 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>nmb.NetBIOSProtocol — pysmb 1.0.0 documentation</title> | |
10 | <title>nmb.NetBIOSProtocol — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
159 | 159 | <li class="right" style="margin-right: 10px"> |
160 | 160 | <a href="../../genindex.html" title="General Index" |
161 | 161 | >index</a></li> |
162 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
162 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
163 | 163 | <li><a href="../index.html" >Module code</a> »</li> |
164 | 164 | </ul> |
165 | 165 | </div> |
166 | 166 | <div class="footer"> |
167 | © Copyright 2011, Michael Teo. | |
167 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
168 | 168 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
169 | 169 | </div> |
170 | 170 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>smb.SMBConnection — pysmb 1.0.0 documentation</title> | |
10 | <title>smb.SMBConnection — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
480 | 480 | <li class="right" style="margin-right: 10px"> |
481 | 481 | <a href="../../genindex.html" title="General Index" |
482 | 482 | >index</a></li> |
483 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
483 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
484 | 484 | <li><a href="../index.html" >Module code</a> »</li> |
485 | 485 | </ul> |
486 | 486 | </div> |
487 | 487 | <div class="footer"> |
488 | © Copyright 2011, Michael Teo. | |
488 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
489 | 489 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
490 | 490 | </div> |
491 | 491 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>smb.SMBProtocol — pysmb 1.0.0 documentation</title> | |
10 | <title>smb.SMBProtocol — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
392 | 392 | <li class="right" style="margin-right: 10px"> |
393 | 393 | <a href="../../genindex.html" title="General Index" |
394 | 394 | >index</a></li> |
395 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
395 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
396 | 396 | <li><a href="../index.html" >Module code</a> »</li> |
397 | 397 | </ul> |
398 | 398 | </div> |
399 | 399 | <div class="footer"> |
400 | © Copyright 2011, Michael Teo. | |
400 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
401 | 401 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
402 | 402 | </div> |
403 | 403 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>smb.base — pysmb 1.0.0 documentation</title> | |
10 | <title>smb.base — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
977 | 977 | <li class="right" style="margin-right: 10px"> |
978 | 978 | <a href="../../genindex.html" title="General Index" |
979 | 979 | >index</a></li> |
980 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
980 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
981 | 981 | <li><a href="../index.html" >Module code</a> »</li> |
982 | 982 | </ul> |
983 | 983 | </div> |
984 | 984 | <div class="footer"> |
985 | © Copyright 2011, Michael Teo. | |
985 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
986 | 986 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
987 | 987 | </div> |
988 | 988 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>smb.smb_structs — pysmb 1.0.0 documentation</title> | |
10 | <title>smb.smb_structs — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../../index.html" /> | |
28 | 28 | <link rel="up" title="Module code" href="../index.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
34 | 34 | <li class="right" style="margin-right: 10px"> |
35 | 35 | <a href="../../genindex.html" title="General Index" |
36 | 36 | accesskey="I">index</a></li> |
37 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
37 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
38 | 38 | <li><a href="../index.html" accesskey="U">Module code</a> »</li> |
39 | 39 | </ul> |
40 | 40 | </div> |
1354 | 1354 | <li class="right" style="margin-right: 10px"> |
1355 | 1355 | <a href="../../genindex.html" title="General Index" |
1356 | 1356 | >index</a></li> |
1357 | <li><a href="../../index.html">pysmb 1.0.0 documentation</a> »</li> | |
1357 | <li><a href="../../index.html">pysmb 1.1.5 documentation</a> »</li> | |
1358 | 1358 | <li><a href="../index.html" >Module code</a> »</li> |
1359 | 1359 | </ul> |
1360 | 1360 | </div> |
1361 | 1361 | <div class="footer"> |
1362 | © Copyright 2011, Michael Teo. | |
1362 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
1363 | 1363 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
1364 | 1364 | </div> |
1365 | 1365 | </body> |
4 | 4 | The SMBConnection is suitable for developers who wish to use pysmb to perform file operations with a remote SMB/CIFS server sequentially. |
5 | 5 | |
6 | 6 | Each file operation method, when invoked, will block and return after it has completed or has encountered an error. |
7 | ||
8 | Example | |
9 | ------- | |
10 | ||
11 | The following illustrates a simple file retrieving implementation.:: | |
12 | ||
13 | import tempfile | |
14 | from smb.SMBConnection import SMBConnection | |
15 | ||
16 | # There will be some mechanism to capture userID, password, client_machine_name, server_name and server_ip | |
17 | # client_machine_name can be an arbitary ASCII string | |
18 | # server_name should match the remote machine name, or else the connection will be rejected | |
19 | conn = SMBConnection(userID, password, client_machine_name, server_name, use_ntlm_v2 = True) | |
20 | assert conn.connect(server_ip, 139) | |
21 | ||
22 | file_obj = tempfile.NamedTemporaryFile() | |
23 | file_attributes, filesize = conn.retrieveFile('smbtest', '/rfc1001.txt', file_obj) | |
24 | ||
25 | # Retrieved file contents are inside file_obj | |
26 | # Do what you need with the file_obj and then close it | |
27 | # Note that the file obj is positioned at the end-of-file, | |
28 | # so you might need to perform a file_obj.seek() if you need | |
29 | # to read from the beginning | |
30 | file_obj.close() | |
31 | ||
32 | SMB2 Support | |
33 | ------------- | |
34 | ||
35 | Starting from pysmb 1.1.0, pysmb will utilize SMB2 protocol for communication if the remote SMB/CIFS service supports SMB2. | |
36 | Otherwise, it will fallback automatically back to using SMB1 protocol. | |
37 | ||
38 | To disable SMB2 protocol in pysmb, set the *SUPPORT_SMB2* flag in the *smb_structs* module to *False* before creating the *SMBConnection* instance.:: | |
39 | ||
40 | from smb import smb_structs | |
41 | smb_structs.SUPPORT_SMB2 = False | |
7 | 42 | |
8 | 43 | Caveats |
9 | 44 | ------- |
0 | ||
1 | SMbHandler Class | |
2 | ================ | |
3 | ||
4 | The SMBHandler class provides support for "smb://" URLs in the `urllib2 <http://docs.python.org/library/urllib2.html>`_ python package. | |
5 | ||
6 | Notes | |
7 | ----- | |
8 | * Note that you need to pass in a valid hostname or IP address for the host component of the URL. | |
9 | Do not use the Windows/NetBIOS machine name for the host component. | |
10 | * The first component of the path in the URL points to the name of the shared folder. | |
11 | Subsequent path components will point to the directory/folder of the file. | |
12 | * You can retrieve and upload files, but you cannot delete files/folders or create folders. | |
13 | In uploads, if the parent folders do not exist, an *urllib2.URLError* will be raised. | |
14 | ||
15 | Example | |
16 | ------- | |
17 | ||
18 | The following code snippet illustrates file retrieval.:: | |
19 | ||
20 | # -*- coding: utf-8 -*- | |
21 | import urllib2 | |
22 | from smb.SMBHandler import SMBHandler | |
23 | ||
24 | director = urllib2.build_opener(SMBHandler) | |
25 | fh = director.open('smb://myuserID:[email protected]/sharedfolder/rfc1001.txt') | |
26 | ||
27 | # Process fh like a file-like object and then close it. | |
28 | fh.close() | |
29 | ||
30 | # For paths/files with unicode characters, simply pass in the URL as an unicode string | |
31 | fh2 = director.open(u'smb://myuserID:[email protected]/sharedfolder/测试文件夹/垃圾文件.dat') | |
32 | ||
33 | # Process fh2 like a file-like object and then close it. | |
34 | fh2.close() | |
35 | ||
36 | The following code snippet illustrates file upload. You need to provide a file-like object for the *data* parameter in the *open()* method:: | |
37 | ||
38 | import urllib2 | |
39 | from smb.SMBHandler import SMBHandler | |
40 | ||
41 | file_fh = open('local_file.dat', 'rb') | |
42 | ||
43 | director = urllib2.build_opener(SMBHandler) | |
44 | fh = director.open('smb://myuserID:[email protected]/sharedfolder/upload_file.dat', data = file_fh) | |
45 | ||
46 | # Reading from fh will only return an empty string | |
47 | fh.close() |
23 | 23 | add a handling method to the returned *Deferred* instance via *Deferred.addCallback*. If the file operation fails, the *Deferred.errback* function will be called |
24 | 24 | with an :doc:`OperationFailure<smb_exceptions>`; on timeout, it will be called with a :doc:`SMBTimeout<smb_exceptions>`. |
25 | 25 | |
26 | Example | |
27 | ------- | |
28 | ||
29 | The following illustrates a simple file retrieving implementation.:: | |
30 | ||
31 | import tempfile | |
32 | from twisted.internet import reactor | |
33 | from smb.SMBProtocol import SMBProtocolFactory | |
34 | ||
35 | class RetrieveFileFactory(SMBProtocolFactory): | |
36 | ||
37 | def __init__(self, *args, **kwargs): | |
38 | SMBProtocolFactory.__init__(self, *args, **kwargs) | |
39 | ||
40 | def fileRetrieved(self, write_result): | |
41 | file_obj, file_attributes, file_size = write_result | |
42 | ||
43 | # Retrieved file contents are inside file_obj | |
44 | # Do what you need with the file_obj and then close it | |
45 | # Note that the file obj is positioned at the end-of-file, | |
46 | # so you might need to perform a file_obj.seek() to if you | |
47 | # need to read from the beginning | |
48 | file_obj.close() | |
49 | ||
50 | self.transport.loseConnection() | |
51 | ||
52 | def onAuthOK(self): | |
53 | d = self.retrieveFile(self.service, self.path, tempfile.NamedTemporaryFile()) | |
54 | d.addCallback(self.fileRetrieved) | |
55 | d.addErrback(self.d.errback) | |
56 | ||
57 | def onAuthFailed(self): | |
58 | print 'Auth failed' | |
59 | ||
60 | # There will be some mechanism to capture userID, password, client_machine_name, server_name and server_ip | |
61 | # client_machine_name can be an arbitary ASCII string | |
62 | # server_name should match the remote machine name, or else the connection will be rejected | |
63 | factory = RetrieveFileFactory(userID, password, client_machine_name, server_name, use_ntlm_v2 = True) | |
64 | factory.service = 'smbtest' | |
65 | factory.path = '/rfc1001.txt' | |
66 | reactor.connectTCP(server_ip, 139, factory) | |
67 | ||
68 | ||
69 | ||
70 | ||
71 | SMB2 Support | |
72 | ------------- | |
73 | ||
74 | Starting from pysmb 1.1.0, pysmb will utilize SMB2 protocol for communication if the remote SMB/CIFS service supports SMB2. | |
75 | Otherwise, it will fallback automatically back to using SMB1 protocol. | |
76 | ||
77 | To disable SMB2 protocol in pysmb, set the *SUPPORT_SMB2* flag in the *smb_structs* module to *False* before creating the *SMBProtocolFactory* instance.:: | |
78 | ||
79 | from smb import smb_structs | |
80 | smb_structs.SUPPORT_SMB2 = False | |
81 | ||
26 | 82 | Caveats |
27 | 83 | ------- |
28 | 84 |
5 | 5 | Welcome to pysmb's documentation! |
6 | 6 | ================================= |
7 | 7 | |
8 | pysmb is a pure Python implementation of the client-side SMB/CIFS protocol which is the underlying protocol that facilitates file sharing and printing between Windows machines, | |
9 | as well as with Linux machines via the Samba server application. | |
10 | pysmb is developed in Python 2.4.6 (and Python 2.7.1) and has been tested against shared folders on Windows XP SP3, Windows Vista, Windows 7 and Samba 3.x. | |
8 | pysmb is a pure Python implementation of the client-side SMB/CIFS protocol (SMB1 and SMB2) which is the underlying protocol | |
9 | that facilitates file sharing and printing between Windows machines, as well as with Linux machines via the Samba server application. | |
10 | pysmb is developed in Python 2.4.6, Python 2.7.1 and Python 3.2.3 and has been tested against shared folders on Windows XP SP3, Windows Vista, Windows 7 and Samba 3.x. | |
11 | ||
12 | The latest version of pysmb is always available at the pysmb project page at `miketeo.net <http://miketeo.net/wp/index.php/projects/pysmb>`_. | |
11 | 13 | |
12 | 14 | License |
13 | 15 | ------- |
25 | 27 | |
26 | 28 | * **pyasn1** : Pure Python implementation of ASN.1 parsing and encoding (not included together with pysmb; needs to be installed separately) |
27 | 29 | * **md4** and **U32** : Pure Python implementation of MD4 hashing algorithm and 32-bit unsigned integer by Dmitry Rozmanov. Licensed under LGPL and included together with pysmb. |
28 | * **pyDes** : Pure python implementation of the DES encryption algorithm by Todd Whiteman. Free domain and included together with pysmb. | |
30 | * **pyDes** : Pure Python implementation of the DES encryption algorithm by Todd Whiteman. Free domain and included together with pysmb. | |
31 | * **sha256** : Pure Python implementation of SHA-256 message digest by Thomas Dixon. Licensed under MIT and included together with pysmb. This module is imported only when | |
32 | the Python standard library (usually Python 2.4) does not provide the SHA-256 hash algorithm. | |
29 | 33 | |
30 | 34 | In various places, there are references to different specifications. Most of these referenced specifications |
31 | 35 | can be downloaded from Microsoft web site under Microsoft's "Open Specification Promise". If you need to download |
54 | 58 | * **smb/securityblob.py** : |
55 | 59 | Provides routines to encode/decode the NTLMSSP security blob in the SMB messages. |
56 | 60 | * **smb/smb_constants.py** : |
57 | All the constants used in the smb package | |
61 | All the constants used in the smb package for SMB1 protocol | |
58 | 62 | * **smb/smb_structs.py** : |
59 | Contains the internal classes used in the SMB package. These classes are usually used to encode/decode the parameter and data blocks of specific SMB message. | |
63 | Contains the internal classes used in the SMB package for SMB1 protocol. These classes are usually used to encode/decode the parameter and data blocks of specific SMB1 message. | |
64 | * **smb/smb2_constants.py** : | |
65 | All the constants used in the smb package for SMB2 protocol | |
66 | * **smb/smb2_structs.py** : | |
67 | Contains the internal classes used in the SMB package for SMB2 protocol. These classes are usually used to encode/decode the parameter and data blocks of specific SMB2 message. | |
60 | 68 | * **smb/SMBConnection.py** : |
61 | 69 | Contains a SMB protocol implementation. All operations are blocking I/O. |
62 | 70 | * **smb/SMBProtocol.py** : |
63 | 71 | Contains the SMB protocol implementation for use in the Twisted framework. |
72 | * **smb/SMBHandler.py** : | |
73 | Provides support for "smb://" URL in the urllib2 python package. | |
64 | 74 | |
65 | 75 | Using pysmb |
66 | 76 | =========== |
74 | 84 | * To use pysmb in applications where you want the file operations to return after they have completed (synchronous style), please read |
75 | 85 | :doc:`smb.SMBConnection.SMBConnection<api/smb_SMBConnection>` documentation. |
76 | 86 | * To use pysmb in Twisted, please read :doc:`smb.SMBProtocol.SMBProtocolFactory<api/smb_SMBProtocolFactory>` documentation. |
87 | * To support "smb://" URL in urllib2 python package, read :doc:`smb.SMBHandler.SMBHandler<api/smb_SMBHandler>` documentation. | |
77 | 88 | |
78 | 89 | As a software developer who is looking to modify pysmb so that you can integrate it to other network frameworks: |
79 | 90 | * Read :doc:`extending` |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>NBNSProtocol Class — pysmb 1.0.0 documentation</title> | |
10 | <title>NBNSProtocol Class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="NetBIOS class" href="nmb_NetBIOS.html" /> |
29 | 29 | <link rel="prev" title="Welcome to pysmb’s documentation!" href="../index.html" /> |
30 | 30 | </head> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="../index.html" title="Welcome to pysmb’s documentation!" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
114 | 114 | </dd></dl> |
115 | 115 | |
116 | 116 | <dl class="method"> |
117 | <dt id="nmb.NetBIOSProtocol.NBNSProtocol.queryIPForName"> | |
118 | <tt class="descname">queryIPForName</tt><big>(</big><em>ip</em>, <em>port=137</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#nmb.NetBIOSProtocol.NBNSProtocol.queryIPForName" title="Permalink to this definition">¶</a></dt> | |
119 | <dd><p>Send a query to the machine with <em>ip</em> and hopes that the machine will reply back with its name.</p> | |
120 | <p>The implementation of this function is contributed by Jason Anderson.</p> | |
121 | <table class="docutils field-list" frame="void" rules="none"> | |
122 | <col class="field-name" /> | |
123 | <col class="field-body" /> | |
124 | <tbody valign="top"> | |
125 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
126 | <li><strong>ip</strong> (<em>string</em>) – If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address. | |
127 | If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</li> | |
128 | <li><strong>port</strong> (<em>integer</em>) – The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</li> | |
129 | <li><strong>timeout</strong> (<em>integer/float</em>) – Number of seconds to wait for a reply, after which the method will return None</li> | |
130 | </ul> | |
131 | </td> | |
132 | </tr> | |
133 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A <em>twisted.internet.defer.Deferred</em> instance. The callback function will be called with a list of names of the machine at <em>ip</em>. | |
134 | On timeout, the errback function will be called with a Failure instance wrapping around a NetBIOSTimeout exception</p> | |
135 | </td> | |
136 | </tr> | |
137 | </tbody> | |
138 | </table> | |
139 | </dd></dl> | |
140 | ||
141 | <dl class="method"> | |
117 | 142 | <dt id="nmb.NetBIOSProtocol.NBNSProtocol.queryName"> |
118 | 143 | <tt class="descname">queryName</tt><big>(</big><em>name</em>, <em>ip=''</em>, <em>port=137</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/nmb/NetBIOSProtocol.html#NBNSProtocol.queryName"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nmb.NetBIOSProtocol.NBNSProtocol.queryName" title="Permalink to this definition">¶</a></dt> |
119 | 144 | <dd><p>Send a query on the network and hopes that if machine matching the <em>name</em> will reply with its IP address.</p> |
165 | 190 | <li class="right" > |
166 | 191 | <a href="../index.html" title="Welcome to pysmb’s documentation!" |
167 | 192 | >previous</a> |</li> |
168 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
193 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
169 | 194 | </ul> |
170 | 195 | </div> |
171 | 196 | <div class="footer"> |
172 | © Copyright 2011, Michael Teo. | |
197 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
173 | 198 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
174 | 199 | </div> |
175 | 200 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>NetBIOS class — pysmb 1.0.0 documentation</title> | |
10 | <title>NetBIOS class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="SMBConnection Class" href="smb_SMBConnection.html" /> |
29 | 29 | <link rel="prev" title="NBNSProtocol Class" href="nmb_NBNSProtocol.html" /> |
30 | 30 | </head> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="nmb_NBNSProtocol.html" title="NBNSProtocol Class" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
126 | 126 | </dd></dl> |
127 | 127 | |
128 | 128 | <dl class="method"> |
129 | <dt id="nmb.NetBIOS.NetBIOS.queryName"> | |
130 | <tt class="descname">queryName</tt><big>(</big><em>name</em>, <em>ip=''</em>, <em>port=137</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/nmb/NetBIOS.html#NetBIOS.queryName"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nmb.NetBIOS.NetBIOS.queryName" title="Permalink to this definition">¶</a></dt> | |
131 | <dd><p>Send a query on the network and hopes that if machine matching the <em>name</em> will reply with its IP address.</p> | |
129 | <dt id="nmb.NetBIOS.NetBIOS.queryIPForName"> | |
130 | <tt class="descname">queryIPForName</tt><big>(</big><em>ip</em>, <em>port=137</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#nmb.NetBIOS.NetBIOS.queryIPForName" title="Permalink to this definition">¶</a></dt> | |
131 | <dd><p>Send a query to the machine with <em>ip</em> and hopes that the machine will reply back with its name.</p> | |
132 | <p>The implementation of this function is contributed by Jason Anderson.</p> | |
132 | 133 | <table class="docutils field-list" frame="void" rules="none"> |
133 | 134 | <col class="field-name" /> |
134 | 135 | <col class="field-body" /> |
141 | 142 | </ul> |
142 | 143 | </td> |
143 | 144 | </tr> |
145 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of string containing the names of the machine at <em>ip</em>. On timeout, returns None.</p> | |
146 | </td> | |
147 | </tr> | |
148 | </tbody> | |
149 | </table> | |
150 | </dd></dl> | |
151 | ||
152 | <dl class="method"> | |
153 | <dt id="nmb.NetBIOS.NetBIOS.queryName"> | |
154 | <tt class="descname">queryName</tt><big>(</big><em>name</em>, <em>ip=''</em>, <em>port=137</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/nmb/NetBIOS.html#NetBIOS.queryName"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#nmb.NetBIOS.NetBIOS.queryName" title="Permalink to this definition">¶</a></dt> | |
155 | <dd><p>Send a query on the network and hopes that if machine matching the <em>name</em> will reply with its IP address.</p> | |
156 | <table class="docutils field-list" frame="void" rules="none"> | |
157 | <col class="field-name" /> | |
158 | <col class="field-body" /> | |
159 | <tbody valign="top"> | |
160 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
161 | <li><strong>ip</strong> (<em>string</em>) – If the NBNSProtocol instance was instianted with broadcast=True, then this parameter can be an empty string. We will leave it to the OS to determine an appropriate broadcast address. | |
162 | If the NBNSProtocol instance was instianted with broadcast=False, then you should provide a target IP to send the query.</li> | |
163 | <li><strong>port</strong> (<em>integer</em>) – The NetBIOS-NS port (IANA standard defines this port to be 137). You should not touch this parameter unless you know what you are doing.</li> | |
164 | <li><strong>timeout</strong> (<em>integer/float</em>) – Number of seconds to wait for a reply, after which the method will return None</li> | |
165 | </ul> | |
166 | </td> | |
167 | </tr> | |
144 | 168 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of IP addresses in dotted notation (aaa.bbb.ccc.ddd). On timeout, returns None.</p> |
145 | 169 | </td> |
146 | 170 | </tr> |
170 | 194 | <li class="right" > |
171 | 195 | <a href="nmb_NBNSProtocol.html" title="NBNSProtocol Class" |
172 | 196 | >previous</a> |</li> |
173 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
197 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
174 | 198 | </ul> |
175 | 199 | </div> |
176 | 200 | <div class="footer"> |
177 | © Copyright 2011, Michael Teo. | |
201 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
178 | 202 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
179 | 203 | </div> |
180 | 204 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>SMBConnection Class — pysmb 1.0.0 documentation</title> | |
10 | <title>SMBConnection Class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
28 | <link rel="next" title="SMBProtocolFactory Class" href="smb_SMBProtocolFactory.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | <link rel="next" title="SMbHandler Class" href="smb_SMBHandler.html" /> | |
29 | 29 | <link rel="prev" title="NetBIOS class" href="nmb_NetBIOS.html" /> |
30 | 30 | </head> |
31 | 31 | <body> |
36 | 36 | <a href="../genindex.html" title="General Index" |
37 | 37 | accesskey="I">index</a></li> |
38 | 38 | <li class="right" > |
39 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" | |
39 | <a href="smb_SMBHandler.html" title="SMbHandler Class" | |
40 | 40 | accesskey="N">next</a> |</li> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="nmb_NetBIOS.html" title="NetBIOS class" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
49 | 49 | <h3><a href="../index.html">Table Of Contents</a></h3> |
50 | 50 | <ul> |
51 | 51 | <li><a class="reference internal" href="#">SMBConnection Class</a><ul> |
52 | <li><a class="reference internal" href="#example">Example</a></li> | |
53 | <li><a class="reference internal" href="#smb2-support">SMB2 Support</a></li> | |
52 | 54 | <li><a class="reference internal" href="#caveats">Caveats</a></li> |
53 | 55 | </ul> |
54 | 56 | </li> |
58 | 60 | <p class="topless"><a href="nmb_NetBIOS.html" |
59 | 61 | title="previous chapter">NetBIOS class</a></p> |
60 | 62 | <h4>Next topic</h4> |
61 | <p class="topless"><a href="smb_SMBProtocolFactory.html" | |
62 | title="next chapter">SMBProtocolFactory Class</a></p> | |
63 | <p class="topless"><a href="smb_SMBHandler.html" | |
64 | title="next chapter">SMbHandler Class</a></p> | |
63 | 65 | <h3>This Page</h3> |
64 | 66 | <ul class="this-page-menu"> |
65 | 67 | <li><a href="../_sources/api/smb_SMBConnection.txt" |
90 | 92 | <h1>SMBConnection Class<a class="headerlink" href="#smbconnection-class" title="Permalink to this headline">¶</a></h1> |
91 | 93 | <p>The SMBConnection is suitable for developers who wish to use pysmb to perform file operations with a remote SMB/CIFS server sequentially.</p> |
92 | 94 | <p>Each file operation method, when invoked, will block and return after it has completed or has encountered an error.</p> |
95 | <div class="section" id="example"> | |
96 | <h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2> | |
97 | <p>The following illustrates a simple file retrieving implementation.:</p> | |
98 | <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">tempfile</span> | |
99 | <span class="kn">from</span> <span class="nn">smb.SMBConnection</span> <span class="kn">import</span> <span class="n">SMBConnection</span> | |
100 | ||
101 | <span class="c"># There will be some mechanism to capture userID, password, client_machine_name, server_name and server_ip</span> | |
102 | <span class="c"># client_machine_name can be an arbitary ASCII string</span> | |
103 | <span class="c"># server_name should match the remote machine name, or else the connection will be rejected</span> | |
104 | <span class="n">conn</span> <span class="o">=</span> <span class="n">SMBConnection</span><span class="p">(</span><span class="n">userID</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">client_machine_name</span><span class="p">,</span> <span class="n">server_name</span><span class="p">,</span> <span class="n">use_ntlm_v2</span> <span class="o">=</span> <span class="bp">True</span><span class="p">)</span> | |
105 | <span class="k">assert</span> <span class="n">conn</span><span class="o">.</span><span class="n">connect</span><span class="p">(</span><span class="n">server_ip</span><span class="p">,</span> <span class="mi">139</span><span class="p">)</span> | |
106 | ||
107 | <span class="n">file_obj</span> <span class="o">=</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">NamedTemporaryFile</span><span class="p">()</span> | |
108 | <span class="n">file_attributes</span><span class="p">,</span> <span class="n">filesize</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">retrieveFile</span><span class="p">(</span><span class="s">'smbtest'</span><span class="p">,</span> <span class="s">'/rfc1001.txt'</span><span class="p">,</span> <span class="n">file_obj</span><span class="p">)</span> | |
109 | ||
110 | <span class="c"># Retrieved file contents are inside file_obj</span> | |
111 | <span class="c"># Do what you need with the file_obj and then close it</span> | |
112 | <span class="c"># Note that the file obj is positioned at the end-of-file,</span> | |
113 | <span class="c"># so you might need to perform a file_obj.seek() if you need</span> | |
114 | <span class="c"># to read from the beginning</span> | |
115 | <span class="n">file_obj</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | |
116 | </pre></div> | |
117 | </div> | |
118 | </div> | |
119 | <div class="section" id="smb2-support"> | |
120 | <h2>SMB2 Support<a class="headerlink" href="#smb2-support" title="Permalink to this headline">¶</a></h2> | |
121 | <p>Starting from pysmb 1.1.0, pysmb will utilize SMB2 protocol for communication if the remote SMB/CIFS service supports SMB2. | |
122 | Otherwise, it will fallback automatically back to using SMB1 protocol.</p> | |
123 | <p>To disable SMB2 protocol in pysmb, set the <em>SUPPORT_SMB2</em> flag in the <em>smb_structs</em> module to <em>False</em> before creating the <em>SMBConnection</em> instance.:</p> | |
124 | <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">smb</span> <span class="kn">import</span> <span class="n">smb_structs</span> | |
125 | <span class="n">smb_structs</span><span class="o">.</span><span class="n">SUPPORT_SMB2</span> <span class="o">=</span> <span class="bp">False</span> | |
126 | </pre></div> | |
127 | </div> | |
128 | </div> | |
93 | 129 | <div class="section" id="caveats"> |
94 | 130 | <h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2> |
95 | 131 | <ul class="simple"> |
101 | 137 | </ul> |
102 | 138 | <dl class="class"> |
103 | 139 | <dt id="smb.SMBConnection.SMBConnection"> |
104 | <em class="property">class </em><tt class="descclassname">smb.SMBConnection.</tt><tt class="descname">SMBConnection</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection" title="Permalink to this definition">¶</a></dt> | |
140 | <em class="property">class </em><tt class="descclassname">smb.SMBConnection.</tt><tt class="descname">SMBConnection</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em>, <em>sign_options=2</em>, <em>is_direct_tcp=False</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection" title="Permalink to this definition">¶</a></dt> | |
105 | 141 | <dd><dl class="method"> |
106 | 142 | <dt id="smb.SMBConnection.SMBConnection.__init__"> |
107 | <tt class="descname">__init__</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.__init__" title="Permalink to this definition">¶</a></dt> | |
143 | <tt class="descname">__init__</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em>, <em>sign_options=2</em>, <em>is_direct_tcp=False</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.__init__" title="Permalink to this definition">¶</a></dt> | |
108 | 144 | <dd><p>Create a new SMBConnection instance.</p> |
109 | 145 | <p><em>username</em> and <em>password</em> are the user credentials required to authenticate the underlying SMB connection with the remote server. |
110 | 146 | File operations can only be proceeded after the connection has been authenticated successfully.</p> |
111 | 147 | <p>Note that you need to call <em>connect</em> method to actually establish the SMB connection to the remote server and perform authentication.</p> |
148 | <p>The default TCP port for most SMB/CIFS servers using NetBIOS over TCP/IP is 139. | |
149 | Some newer server installations might also support Direct hosting of SMB over TCP/IP; for these servers, the default TCP port is 445.</p> | |
112 | 150 | <table class="docutils field-list" frame="void" rules="none"> |
113 | 151 | <col class="field-name" /> |
114 | 152 | <col class="field-body" /> |
124 | 162 | The choice of NTLMv1 and NTLMv2 is configured on the remote server, and there is no mechanism to auto-detect which algorithm has been configured. |
125 | 163 | Hence, we can only “guess” or try both algorithms. |
126 | 164 | On Sambda, Windows Vista and Windows 7, NTLMv2 is enabled by default. On Windows XP, we can use NTLMv1 before NTLMv2.</li> |
165 | <li><strong>sign_options</strong> (<em>int</em>) – Determines whether SMB messages will be signed. Default is <em>SIGN_WHEN_REQUIRED</em>. | |
166 | If <em>SIGN_WHEN_REQUIRED</em> (value=2), SMB messages will only be signed when remote server requires signing. | |
167 | If <em>SIGN_WHEN_SUPPORTED</em> (value=1), SMB messages will be signed when remote server supports signing but not requires signing. | |
168 | If <em>SIGN_NEVER</em> (value=0), SMB messages will never be signed regardless of remote server’s configurations; access errors will occur if the remote server requires signing.</li> | |
169 | <li><strong>is_direct_tcp</strong> (<em>boolean</em>) – Controls whether the NetBIOS over TCP/IP (is_direct_tcp=False) or the newer Direct hosting of SMB over TCP/IP (is_direct_tcp=True) will be used for the communication. | |
170 | The default parameter is False which will use NetBIOS over TCP/IP for wider compatibility (TCP port: 139).</li> | |
127 | 171 | </ul> |
128 | 172 | </td> |
129 | 173 | </tr> |
139 | 183 | |
140 | 184 | <dl class="method"> |
141 | 185 | <dt id="smb.SMBConnection.SMBConnection.connect"> |
142 | <tt class="descname">connect</tt><big>(</big><em>ip</em>, <em>port</em>, <em>sock_family=2</em>, <em>timeout=60</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.connect" title="Permalink to this definition">¶</a></dt> | |
186 | <tt class="descname">connect</tt><big>(</big><em>ip</em>, <em>port=139</em>, <em>sock_family=2</em>, <em>timeout=60</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.connect"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.connect" title="Permalink to this definition">¶</a></dt> | |
143 | 187 | <dd><p>Establish the SMB connection to the remote SMB/CIFS server.</p> |
144 | 188 | <p>You must call this method before attempting any of the file operations with the remote server. |
145 | 189 | This method will block until the SMB connection has attempted at least one authentication.</p> |
238 | 282 | |
239 | 283 | <dl class="method"> |
240 | 284 | <dt id="smb.SMBConnection.SMBConnection.listPath"> |
241 | <tt class="descname">listPath</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>search=55</em>, <em>pattern='\*'</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.listPath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.listPath" title="Permalink to this definition">¶</a></dt> | |
285 | <tt class="descname">listPath</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>search=55</em>, <em>pattern='*'</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.listPath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.listPath" title="Permalink to this definition">¶</a></dt> | |
242 | 286 | <dd><p>Retrieve a directory listing of files/folders at <em>path</em></p> |
243 | 287 | <table class="docutils field-list" frame="void" rules="none"> |
244 | 288 | <col class="field-name" /> |
275 | 319 | </dd></dl> |
276 | 320 | |
277 | 321 | <dl class="method"> |
322 | <dt id="smb.SMBConnection.SMBConnection.listSnapshots"> | |
323 | <tt class="descname">listSnapshots</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#smb.SMBConnection.SMBConnection.listSnapshots" title="Permalink to this definition">¶</a></dt> | |
324 | <dd><p>Retrieve a list of available snapshots (shadow copies) for <em>path</em>.</p> | |
325 | <p>Note that snapshot features are only supported on Windows Vista Business, Enterprise and Ultimate, and on all Windows 7 editions.</p> | |
326 | <table class="docutils field-list" frame="void" rules="none"> | |
327 | <col class="field-name" /> | |
328 | <col class="field-body" /> | |
329 | <tbody valign="top"> | |
330 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
331 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> | |
332 | <li><strong>path</strong> (<em>string/unicode</em>) – path relative to the <em>service_name</em> where we are interested in the list of available snapshots</li> | |
333 | </ul> | |
334 | </td> | |
335 | </tr> | |
336 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of python <em>datetime.DateTime</em> instances in GMT/UTC time zone</p> | |
337 | </td> | |
338 | </tr> | |
339 | </tbody> | |
340 | </table> | |
341 | </dd></dl> | |
342 | ||
343 | <dl class="method"> | |
278 | 344 | <dt id="smb.SMBConnection.SMBConnection.rename"> |
279 | 345 | <tt class="descname">rename</tt><big>(</big><em>service_name</em>, <em>old_path</em>, <em>new_path</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.rename"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.rename" title="Permalink to this definition">¶</a></dt> |
280 | 346 | <dd><p>Rename a file or folder at <em>old_path</em> to <em>new_path</em> shared at <em>service_name</em>. Note that this method cannot be used to rename file/folder across different shared folders</p> |
296 | 362 | <dt id="smb.SMBConnection.SMBConnection.retrieveFile"> |
297 | 363 | <tt class="descname">retrieveFile</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>file_obj</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBConnection.html#SMBConnection.retrieveFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBConnection.SMBConnection.retrieveFile" title="Permalink to this definition">¶</a></dt> |
298 | 364 | <dd><p>Retrieve the contents of the file at <em>path</em> on the <em>service_name</em> and write these contents to the provided <em>file_obj</em>.</p> |
365 | <p>Use <em>retrieveFileFromOffset()</em> method if you wish to specify the offset to read from the remote <em>path</em> and/or the number of bytes to write to the <em>file_obj</em>.</p> | |
299 | 366 | <table class="docutils field-list" frame="void" rules="none"> |
300 | 367 | <col class="field-name" /> |
301 | 368 | <col class="field-body" /> |
302 | 369 | <tbody valign="top"> |
303 | 370 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
304 | 371 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> |
305 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file cannot be opened for reading, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be called in the returned <em>Deferred</em> errback.</li> | |
306 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> until EOF is received from the remote service.</li> | |
307 | </ul> | |
308 | </td> | |
309 | </tr> | |
310 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A 2-element tuple of ( file attributes of the file on server, number of bytes retrieved ). | |
372 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file cannot be opened for reading, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be raised.</li> | |
373 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> until EOF is received from the remote service. In Python3, this file-like object must have a <em>write</em> method which accepts a bytes parameter.</li> | |
374 | </ul> | |
375 | </td> | |
376 | </tr> | |
377 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A 2-element tuple of ( file attributes of the file on server, number of bytes written to <em>file_obj</em> ). | |
378 | The file attributes is an integer value made up from a bitwise-OR of <em>SMB_FILE_ATTRIBUTE_xxx</em> bits (see smb_constants.py)</p> | |
379 | </td> | |
380 | </tr> | |
381 | </tbody> | |
382 | </table> | |
383 | </dd></dl> | |
384 | ||
385 | <dl class="method"> | |
386 | <dt id="smb.SMBConnection.SMBConnection.retrieveFileFromOffset"> | |
387 | <tt class="descname">retrieveFileFromOffset</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>file_obj</em>, <em>offset=0</em>, <em>max_length=-1</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#smb.SMBConnection.SMBConnection.retrieveFileFromOffset" title="Permalink to this definition">¶</a></dt> | |
388 | <dd><p>Retrieve the contents of the file at <em>path</em> on the <em>service_name</em> and write these contents to the provided <em>file_obj</em>.</p> | |
389 | <table class="docutils field-list" frame="void" rules="none"> | |
390 | <col class="field-name" /> | |
391 | <col class="field-body" /> | |
392 | <tbody valign="top"> | |
393 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
394 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> | |
395 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file cannot be opened for reading, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be raised.</li> | |
396 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> up to <em>max_length</em> number of bytes. In Python3, this file-like object must have a <em>write</em> method which accepts a bytes parameter.</li> | |
397 | <li><strong>offset</strong> (<em>integer/long</em>) – the offset in the remote <em>path</em> where the first byte will be read and written to <em>file_obj</em>. Must be either zero or a positive integer/long value.</li> | |
398 | <li><strong>max_length</strong> (<em>integer/long</em>) – maximum number of bytes to read from the remote <em>path</em> and write to the <em>file_obj</em>. Specify a negative value to read from <em>offset</em> to the EOF. | |
399 | If zero, the method returns immediately after the file is opened successfully for reading.</li> | |
400 | </ul> | |
401 | </td> | |
402 | </tr> | |
403 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A 2-element tuple of ( file attributes of the file on server, number of bytes written to <em>file_obj</em> ). | |
311 | 404 | The file attributes is an integer value made up from a bitwise-OR of <em>SMB_FILE_ATTRIBUTE_xxx</em> bits (see smb_constants.py)</p> |
312 | 405 | </td> |
313 | 406 | </tr> |
326 | 419 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
327 | 420 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> |
328 | 421 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file at <em>path</em> does not exist, it will be created. Otherwise, it will be overwritten. |
329 | If the <em>path</em> refers to a folder or the file cannot be opened for writing, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be called in the returned <em>Deferred</em> errback.</li> | |
330 | <li><strong>file_obj</strong> – A file-like object that has a <em>read</em> method. Data will read continuously from <em>file_obj</em> until EOF.</li> | |
422 | If the <em>path</em> refers to a folder or the file cannot be opened for writing, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be raised.</li> | |
423 | <li><strong>file_obj</strong> – A file-like object that has a <em>read</em> method. Data will read continuously from <em>file_obj</em> until EOF. In Python3, this file-like object must have a <em>read</em> method which returns a bytes parameter.</li> | |
331 | 424 | </ul> |
332 | 425 | </td> |
333 | 426 | </tr> |
336 | 429 | </tr> |
337 | 430 | </tbody> |
338 | 431 | </table> |
432 | </dd></dl> | |
433 | ||
434 | <dl class="attribute"> | |
435 | <dt id="smb.SMBConnection.SMBConnection.SIGN_NEVER"> | |
436 | <tt class="descname">SIGN_NEVER</tt><em class="property"> = 0</em><a class="headerlink" href="#smb.SMBConnection.SMBConnection.SIGN_NEVER" title="Permalink to this definition">¶</a></dt> | |
437 | <dd><p>SMB messages will never be signed regardless of remote server’s configurations; access errors will occur if the remote server requires signing.</p> | |
438 | </dd></dl> | |
439 | ||
440 | <dl class="attribute"> | |
441 | <dt id="smb.SMBConnection.SMBConnection.SIGN_WHEN_REQUIRED"> | |
442 | <tt class="descname">SIGN_WHEN_REQUIRED</tt><em class="property"> = 2</em><a class="headerlink" href="#smb.SMBConnection.SMBConnection.SIGN_WHEN_REQUIRED" title="Permalink to this definition">¶</a></dt> | |
443 | <dd><p>SMB messages will only be signed when remote server requires signing.</p> | |
444 | </dd></dl> | |
445 | ||
446 | <dl class="attribute"> | |
447 | <dt id="smb.SMBConnection.SMBConnection.SIGN_WHEN_SUPPORTED"> | |
448 | <tt class="descname">SIGN_WHEN_SUPPORTED</tt><em class="property"> = 1</em><a class="headerlink" href="#smb.SMBConnection.SMBConnection.SIGN_WHEN_SUPPORTED" title="Permalink to this definition">¶</a></dt> | |
449 | <dd><p>SMB messages will be signed when remote server supports signing but not requires signing.</p> | |
450 | </dd></dl> | |
451 | ||
452 | <dl class="attribute"> | |
453 | <dt id="smb.SMBConnection.SMBConnection.isUsingSMB2"> | |
454 | <tt class="descname">isUsingSMB2</tt><a class="headerlink" href="#smb.SMBConnection.SMBConnection.isUsingSMB2" title="Permalink to this definition">¶</a></dt> | |
455 | <dd><p>A convenient property to return True if the underlying SMB connection is using SMB2 protocol.</p> | |
339 | 456 | </dd></dl> |
340 | 457 | |
341 | 458 | </dd></dl> |
356 | 473 | <a href="../genindex.html" title="General Index" |
357 | 474 | >index</a></li> |
358 | 475 | <li class="right" > |
359 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" | |
476 | <a href="smb_SMBHandler.html" title="SMbHandler Class" | |
360 | 477 | >next</a> |</li> |
361 | 478 | <li class="right" > |
362 | 479 | <a href="nmb_NetBIOS.html" title="NetBIOS class" |
363 | 480 | >previous</a> |</li> |
364 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
481 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
365 | 482 | </ul> |
366 | 483 | </div> |
367 | 484 | <div class="footer"> |
368 | © Copyright 2011, Michael Teo. | |
485 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
369 | 486 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
370 | 487 | </div> |
371 | 488 | </body> |
0 | ||
1 | ||
2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
3 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
4 | ||
5 | ||
6 | <html xmlns="http://www.w3.org/1999/xhtml"> | |
7 | <head> | |
8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
9 | ||
10 | <title>SMbHandler Class — pysmb 1.1.5 documentation</title> | |
11 | ||
12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> | |
13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> | |
14 | ||
15 | <script type="text/javascript"> | |
16 | var DOCUMENTATION_OPTIONS = { | |
17 | URL_ROOT: '../', | |
18 | VERSION: '1.1.5', | |
19 | COLLAPSE_INDEX: false, | |
20 | FILE_SUFFIX: '.html', | |
21 | HAS_SOURCE: true | |
22 | }; | |
23 | </script> | |
24 | <script type="text/javascript" src="../_static/jquery.js"></script> | |
25 | <script type="text/javascript" src="../_static/underscore.js"></script> | |
26 | <script type="text/javascript" src="../_static/doctools.js"></script> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | <link rel="next" title="SMBProtocolFactory Class" href="smb_SMBProtocolFactory.html" /> | |
29 | <link rel="prev" title="SMBConnection Class" href="smb_SMBConnection.html" /> | |
30 | </head> | |
31 | <body> | |
32 | <div class="related"> | |
33 | <h3>Navigation</h3> | |
34 | <ul> | |
35 | <li class="right" style="margin-right: 10px"> | |
36 | <a href="../genindex.html" title="General Index" | |
37 | accesskey="I">index</a></li> | |
38 | <li class="right" > | |
39 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" | |
40 | accesskey="N">next</a> |</li> | |
41 | <li class="right" > | |
42 | <a href="smb_SMBConnection.html" title="SMBConnection Class" | |
43 | accesskey="P">previous</a> |</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | </ul> | |
46 | </div> | |
47 | <div class="sphinxsidebar"> | |
48 | <div class="sphinxsidebarwrapper"> | |
49 | <h3><a href="../index.html">Table Of Contents</a></h3> | |
50 | <ul> | |
51 | <li><a class="reference internal" href="#">SMbHandler Class</a><ul> | |
52 | <li><a class="reference internal" href="#notes">Notes</a></li> | |
53 | <li><a class="reference internal" href="#example">Example</a></li> | |
54 | </ul> | |
55 | </li> | |
56 | </ul> | |
57 | ||
58 | <h4>Previous topic</h4> | |
59 | <p class="topless"><a href="smb_SMBConnection.html" | |
60 | title="previous chapter">SMBConnection Class</a></p> | |
61 | <h4>Next topic</h4> | |
62 | <p class="topless"><a href="smb_SMBProtocolFactory.html" | |
63 | title="next chapter">SMBProtocolFactory Class</a></p> | |
64 | <h3>This Page</h3> | |
65 | <ul class="this-page-menu"> | |
66 | <li><a href="../_sources/api/smb_SMBHandler.txt" | |
67 | rel="nofollow">Show Source</a></li> | |
68 | </ul> | |
69 | <div id="searchbox" style="display: none"> | |
70 | <h3>Quick search</h3> | |
71 | <form class="search" action="../search.html" method="get"> | |
72 | <input type="text" name="q" /> | |
73 | <input type="submit" value="Go" /> | |
74 | <input type="hidden" name="check_keywords" value="yes" /> | |
75 | <input type="hidden" name="area" value="default" /> | |
76 | </form> | |
77 | <p class="searchtip" style="font-size: 90%"> | |
78 | Enter search terms or a module, class or function name. | |
79 | </p> | |
80 | </div> | |
81 | <script type="text/javascript">$('#searchbox').show(0);</script> | |
82 | </div> | |
83 | </div> | |
84 | ||
85 | <div class="document"> | |
86 | <div class="documentwrapper"> | |
87 | <div class="bodywrapper"> | |
88 | <div class="body"> | |
89 | ||
90 | <div class="section" id="smbhandler-class"> | |
91 | <h1>SMbHandler Class<a class="headerlink" href="#smbhandler-class" title="Permalink to this headline">¶</a></h1> | |
92 | <p>The SMBHandler class provides support for “<a class="reference external" href="smb://">smb://</a>” URLs in the <a class="reference external" href="http://docs.python.org/library/urllib2.html">urllib2</a> python package.</p> | |
93 | <div class="section" id="notes"> | |
94 | <h2>Notes<a class="headerlink" href="#notes" title="Permalink to this headline">¶</a></h2> | |
95 | <ul class="simple"> | |
96 | <li>Note that you need to pass in a valid hostname or IP address for the host component of the URL. | |
97 | Do not use the Windows/NetBIOS machine name for the host component.</li> | |
98 | <li>The first component of the path in the URL points to the name of the shared folder. | |
99 | Subsequent path components will point to the directory/folder of the file.</li> | |
100 | <li>You can retrieve and upload files, but you cannot delete files/folders or create folders. | |
101 | In uploads, if the parent folders do not exist, an <em>urllib2.URLError</em> will be raised.</li> | |
102 | </ul> | |
103 | </div> | |
104 | <div class="section" id="example"> | |
105 | <h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2> | |
106 | <p>The following code snippet illustrates file retrieval.:</p> | |
107 | <div class="highlight-python"><div class="highlight"><pre><span class="c"># -*- coding: utf-8 -*-</span> | |
108 | <span class="kn">import</span> <span class="nn">urllib2</span> | |
109 | <span class="kn">from</span> <span class="nn">smb.SMBHandler</span> <span class="kn">import</span> <span class="n">SMBHandler</span> | |
110 | ||
111 | <span class="n">director</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">build_opener</span><span class="p">(</span><span class="n">SMBHandler</span><span class="p">)</span> | |
112 | <span class="n">fh</span> <span class="o">=</span> <span class="n">director</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">'smb://myuserID:[email protected]/sharedfolder/rfc1001.txt'</span><span class="p">)</span> | |
113 | ||
114 | <span class="c"># Process fh like a file-like object and then close it.</span> | |
115 | <span class="n">fh</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | |
116 | ||
117 | <span class="c"># For paths/files with unicode characters, simply pass in the URL as an unicode string</span> | |
118 | <span class="n">fh2</span> <span class="o">=</span> <span class="n">director</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">u'smb://myuserID:[email protected]/sharedfolder/测试文件夹/垃圾文件.dat'</span><span class="p">)</span> | |
119 | ||
120 | <span class="c"># Process fh2 like a file-like object and then close it.</span> | |
121 | <span class="n">fh2</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | |
122 | </pre></div> | |
123 | </div> | |
124 | <p>The following code snippet illustrates file upload. You need to provide a file-like object for the <em>data</em> parameter in the <em>open()</em> method:</p> | |
125 | <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">urllib2</span> | |
126 | <span class="kn">from</span> <span class="nn">smb.SMBHandler</span> <span class="kn">import</span> <span class="n">SMBHandler</span> | |
127 | ||
128 | <span class="n">file_fh</span> <span class="o">=</span> <span class="nb">open</span><span class="p">(</span><span class="s">'local_file.dat'</span><span class="p">,</span> <span class="s">'rb'</span><span class="p">)</span> | |
129 | ||
130 | <span class="n">director</span> <span class="o">=</span> <span class="n">urllib2</span><span class="o">.</span><span class="n">build_opener</span><span class="p">(</span><span class="n">SMBHandler</span><span class="p">)</span> | |
131 | <span class="n">fh</span> <span class="o">=</span> <span class="n">director</span><span class="o">.</span><span class="n">open</span><span class="p">(</span><span class="s">'smb://myuserID:[email protected]/sharedfolder/upload_file.dat'</span><span class="p">,</span> <span class="n">data</span> <span class="o">=</span> <span class="n">file_fh</span><span class="p">)</span> | |
132 | ||
133 | <span class="c"># Reading from fh will only return an empty string</span> | |
134 | <span class="n">fh</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | |
135 | </pre></div> | |
136 | </div> | |
137 | </div> | |
138 | </div> | |
139 | ||
140 | ||
141 | </div> | |
142 | </div> | |
143 | </div> | |
144 | <div class="clearer"></div> | |
145 | </div> | |
146 | <div class="related"> | |
147 | <h3>Navigation</h3> | |
148 | <ul> | |
149 | <li class="right" style="margin-right: 10px"> | |
150 | <a href="../genindex.html" title="General Index" | |
151 | >index</a></li> | |
152 | <li class="right" > | |
153 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" | |
154 | >next</a> |</li> | |
155 | <li class="right" > | |
156 | <a href="smb_SMBConnection.html" title="SMBConnection Class" | |
157 | >previous</a> |</li> | |
158 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
159 | </ul> | |
160 | </div> | |
161 | <div class="footer"> | |
162 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
163 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. | |
164 | </div> | |
165 | </body> | |
166 | </html>⏎ |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>SMBProtocolFactory Class — pysmb 1.0.0 documentation</title> | |
10 | <title>SMBProtocolFactory Class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="SharedDevice Class" href="smb_SharedDevice.html" /> |
29 | <link rel="prev" title="SMBConnection Class" href="smb_SMBConnection.html" /> | |
29 | <link rel="prev" title="SMbHandler Class" href="smb_SMBHandler.html" /> | |
30 | 30 | </head> |
31 | 31 | <body> |
32 | 32 | <div class="related"> |
39 | 39 | <a href="smb_SharedDevice.html" title="SharedDevice Class" |
40 | 40 | accesskey="N">next</a> |</li> |
41 | 41 | <li class="right" > |
42 | <a href="smb_SMBConnection.html" title="SMBConnection Class" | |
42 | <a href="smb_SMBHandler.html" title="SMbHandler Class" | |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
49 | 49 | <h3><a href="../index.html">Table Of Contents</a></h3> |
50 | 50 | <ul> |
51 | 51 | <li><a class="reference internal" href="#">SMBProtocolFactory Class</a><ul> |
52 | <li><a class="reference internal" href="#example">Example</a></li> | |
53 | <li><a class="reference internal" href="#smb2-support">SMB2 Support</a></li> | |
52 | 54 | <li><a class="reference internal" href="#caveats">Caveats</a></li> |
53 | 55 | </ul> |
54 | 56 | </li> |
55 | 57 | </ul> |
56 | 58 | |
57 | 59 | <h4>Previous topic</h4> |
58 | <p class="topless"><a href="smb_SMBConnection.html" | |
59 | title="previous chapter">SMBConnection Class</a></p> | |
60 | <p class="topless"><a href="smb_SMBHandler.html" | |
61 | title="previous chapter">SMbHandler Class</a></p> | |
60 | 62 | <h4>Next topic</h4> |
61 | 63 | <p class="topless"><a href="smb_SharedDevice.html" |
62 | 64 | title="next chapter">SharedDevice Class</a></p> |
110 | 112 | <p>If you are interested in learning the results of the operation or to know when the operation has completed, you should |
111 | 113 | add a handling method to the returned <em>Deferred</em> instance via <em>Deferred.addCallback</em>. If the file operation fails, the <em>Deferred.errback</em> function will be called |
112 | 114 | with an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a>; on timeout, it will be called with a <a class="reference internal" href="smb_exceptions.html"><em>SMBTimeout</em></a>.</p> |
115 | <div class="section" id="example"> | |
116 | <h2>Example<a class="headerlink" href="#example" title="Permalink to this headline">¶</a></h2> | |
117 | <p>The following illustrates a simple file retrieving implementation.:</p> | |
118 | <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">tempfile</span> | |
119 | <span class="kn">from</span> <span class="nn">twisted.internet</span> <span class="kn">import</span> <span class="n">reactor</span> | |
120 | <span class="kn">from</span> <span class="nn">smb.SMBProtocol</span> <span class="kn">import</span> <span class="n">SMBProtocolFactory</span> | |
121 | ||
122 | <span class="k">class</span> <span class="nc">RetrieveFileFactory</span><span class="p">(</span><span class="n">SMBProtocolFactory</span><span class="p">):</span> | |
123 | ||
124 | <span class="k">def</span> <span class="nf">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">):</span> | |
125 | <span class="n">SMBProtocolFactory</span><span class="o">.</span><span class="n">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">,</span> <span class="o">**</span><span class="n">kwargs</span><span class="p">)</span> | |
126 | ||
127 | <span class="k">def</span> <span class="nf">fileRetrieved</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">write_result</span><span class="p">):</span> | |
128 | <span class="n">file_obj</span><span class="p">,</span> <span class="n">file_attributes</span><span class="p">,</span> <span class="n">file_size</span> <span class="o">=</span> <span class="n">write_result</span> | |
129 | ||
130 | <span class="c"># Retrieved file contents are inside file_obj</span> | |
131 | <span class="c"># Do what you need with the file_obj and then close it</span> | |
132 | <span class="c"># Note that the file obj is positioned at the end-of-file,</span> | |
133 | <span class="c"># so you might need to perform a file_obj.seek() to if you</span> | |
134 | <span class="c"># need to read from the beginning</span> | |
135 | <span class="n">file_obj</span><span class="o">.</span><span class="n">close</span><span class="p">()</span> | |
136 | ||
137 | <span class="bp">self</span><span class="o">.</span><span class="n">transport</span><span class="o">.</span><span class="n">loseConnection</span><span class="p">()</span> | |
138 | ||
139 | <span class="k">def</span> <span class="nf">onAuthOK</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | |
140 | <span class="n">d</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">retrieveFile</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">service</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">path</span><span class="p">,</span> <span class="n">tempfile</span><span class="o">.</span><span class="n">NamedTemporaryFile</span><span class="p">())</span> | |
141 | <span class="n">d</span><span class="o">.</span><span class="n">addCallback</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">fileRetrieved</span><span class="p">)</span> | |
142 | <span class="n">d</span><span class="o">.</span><span class="n">addErrback</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">d</span><span class="o">.</span><span class="n">errback</span><span class="p">)</span> | |
143 | ||
144 | <span class="k">def</span> <span class="nf">onAuthFailed</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span> | |
145 | <span class="k">print</span> <span class="s">'Auth failed'</span> | |
146 | ||
147 | <span class="c"># There will be some mechanism to capture userID, password, client_machine_name, server_name and server_ip</span> | |
148 | <span class="c"># client_machine_name can be an arbitary ASCII string</span> | |
149 | <span class="c"># server_name should match the remote machine name, or else the connection will be rejected</span> | |
150 | <span class="n">factory</span> <span class="o">=</span> <span class="n">RetrieveFileFactory</span><span class="p">(</span><span class="n">userID</span><span class="p">,</span> <span class="n">password</span><span class="p">,</span> <span class="n">client_machine_name</span><span class="p">,</span> <span class="n">server_name</span><span class="p">,</span> <span class="n">use_ntlm_v2</span> <span class="o">=</span> <span class="bp">True</span><span class="p">)</span> | |
151 | <span class="n">factory</span><span class="o">.</span><span class="n">service</span> <span class="o">=</span> <span class="s">'smbtest'</span> | |
152 | <span class="n">factory</span><span class="o">.</span><span class="n">path</span> <span class="o">=</span> <span class="s">'/rfc1001.txt'</span> | |
153 | <span class="n">reactor</span><span class="o">.</span><span class="n">connectTCP</span><span class="p">(</span><span class="n">server_ip</span><span class="p">,</span> <span class="mi">139</span><span class="p">,</span> <span class="n">factory</span><span class="p">)</span> | |
154 | </pre></div> | |
155 | </div> | |
156 | </div> | |
157 | <div class="section" id="smb2-support"> | |
158 | <h2>SMB2 Support<a class="headerlink" href="#smb2-support" title="Permalink to this headline">¶</a></h2> | |
159 | <p>Starting from pysmb 1.1.0, pysmb will utilize SMB2 protocol for communication if the remote SMB/CIFS service supports SMB2. | |
160 | Otherwise, it will fallback automatically back to using SMB1 protocol.</p> | |
161 | <p>To disable SMB2 protocol in pysmb, set the <em>SUPPORT_SMB2</em> flag in the <em>smb_structs</em> module to <em>False</em> before creating the <em>SMBProtocolFactory</em> instance.:</p> | |
162 | <div class="highlight-python"><div class="highlight"><pre><span class="kn">from</span> <span class="nn">smb</span> <span class="kn">import</span> <span class="n">smb_structs</span> | |
163 | <span class="n">smb_structs</span><span class="o">.</span><span class="n">SUPPORT_SMB2</span> <span class="o">=</span> <span class="bp">False</span> | |
164 | </pre></div> | |
165 | </div> | |
166 | </div> | |
113 | 167 | <div class="section" id="caveats"> |
114 | 168 | <h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2> |
115 | 169 | <ul class="simple"> |
120 | 174 | </ul> |
121 | 175 | <dl class="class"> |
122 | 176 | <dt id="smb.SMBProtocol.SMBProtocolFactory"> |
123 | <em class="property">class </em><tt class="descclassname">smb.SMBProtocol.</tt><tt class="descname">SMBProtocolFactory</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory" title="Permalink to this definition">¶</a></dt> | |
177 | <em class="property">class </em><tt class="descclassname">smb.SMBProtocol.</tt><tt class="descname">SMBProtocolFactory</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em>, <em>sign_options=2</em>, <em>is_direct_tcp=False</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory" title="Permalink to this definition">¶</a></dt> | |
124 | 178 | <dd><dl class="method"> |
125 | 179 | <dt id="smb.SMBProtocol.SMBProtocolFactory.__init__"> |
126 | <tt class="descname">__init__</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.__init__" title="Permalink to this definition">¶</a></dt> | |
127 | <dd><p>Create a new SMBProtocolFactory instance.</p> | |
180 | <tt class="descname">__init__</tt><big>(</big><em>username</em>, <em>password</em>, <em>my_name</em>, <em>remote_name</em>, <em>domain=''</em>, <em>use_ntlm_v2=True</em>, <em>sign_options=2</em>, <em>is_direct_tcp=False</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.__init__"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.__init__" title="Permalink to this definition">¶</a></dt> | |
181 | <dd><p>Create a new SMBProtocolFactory instance. You will pass this instance to <em>reactor.connectTCP()</em> which will then instantiate the TCP connection to the remote SMB/CIFS server. | |
182 | Note that the default TCP port for most SMB/CIFS servers using NetBIOS over TCP/IP is 139. | |
183 | Some newer server installations might also support Direct hosting of SMB over TCP/IP; for these servers, the default TCP port is 445.</p> | |
128 | 184 | <p><em>username</em> and <em>password</em> are the user credentials required to authenticate the underlying SMB connection with the remote server. |
129 | 185 | File operations can only be proceeded after the connection has been authenticated successfully.</p> |
130 | 186 | <table class="docutils field-list" frame="void" rules="none"> |
142 | 198 | The choice of NTLMv1 and NTLMv2 is configured on the remote server, and there is no mechanism to auto-detect which algorithm has been configured. |
143 | 199 | Hence, we can only “guess” or try both algorithms. |
144 | 200 | On Sambda, Windows Vista and Windows 7, NTLMv2 is enabled by default. On Windows XP, we can use NTLMv1 before NTLMv2.</li> |
201 | <li><strong>sign_options</strong> (<em>int</em>) – Determines whether SMB messages will be signed. Default is <em>SIGN_WHEN_REQUIRED</em>. | |
202 | If <em>SIGN_WHEN_REQUIRED</em> (value=2), SMB messages will only be signed when remote server requires signing. | |
203 | If <em>SIGN_WHEN_SUPPORTED</em> (value=1), SMB messages will be signed when remote server supports signing but not requires signing. | |
204 | If <em>SIGN_NEVER</em> (value=0), SMB messages will never be signed regardless of remote server’s configurations; access errors will occur if the remote server requires signing.</li> | |
205 | <li><strong>is_direct_tcp</strong> (<em>boolean</em>) – Controls whether the NetBIOS over TCP/IP (is_direct_tcp=False) or the newer Direct hosting of SMB over TCP/IP (is_direct_tcp=True) will be used for the communication. | |
206 | The default parameter is False which will use NetBIOS over TCP/IP for wider compatibility (TCP port: 139).</li> | |
145 | 207 | </ul> |
146 | 208 | </td> |
147 | 209 | </tr> |
256 | 318 | |
257 | 319 | <dl class="method"> |
258 | 320 | <dt id="smb.SMBProtocol.SMBProtocolFactory.listPath"> |
259 | <tt class="descname">listPath</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>search=55</em>, <em>pattern='\*'</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.listPath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.listPath" title="Permalink to this definition">¶</a></dt> | |
321 | <tt class="descname">listPath</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>search=55</em>, <em>pattern='*'</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.listPath"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.listPath" title="Permalink to this definition">¶</a></dt> | |
260 | 322 | <dd><p>Retrieve a directory listing of files/folders at <em>path</em></p> |
261 | 323 | <table class="docutils field-list" frame="void" rules="none"> |
262 | 324 | <col class="field-name" /> |
290 | 352 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeout</strong> (<em>integer/float</em>) – Number of seconds that pysmb will wait before raising <em>SMBTimeout</em> via the returned <em>Deferred</em> instance’s <em>errback</em> method.</td> |
291 | 353 | </tr> |
292 | 354 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body">A <em>twisted.internet.defer.Deferred</em> instance. The callback function will be called with a list of <a class="reference internal" href="smb_SharedDevice.html"><em>smb.base.SharedDevice</em></a> instances.</td> |
355 | </tr> | |
356 | </tbody> | |
357 | </table> | |
358 | </dd></dl> | |
359 | ||
360 | <dl class="method"> | |
361 | <dt id="smb.SMBProtocol.SMBProtocolFactory.listSnapshots"> | |
362 | <tt class="descname">listSnapshots</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.listSnapshots" title="Permalink to this definition">¶</a></dt> | |
363 | <dd><p>Retrieve a list of available snapshots (a.k.a. shadow copies) for <em>path</em>.</p> | |
364 | <p>Note that snapshot features are only supported on Windows Vista Business, Enterprise and Ultimate, and on all Windows 7 editions.</p> | |
365 | <table class="docutils field-list" frame="void" rules="none"> | |
366 | <col class="field-name" /> | |
367 | <col class="field-body" /> | |
368 | <tbody valign="top"> | |
369 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
370 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> | |
371 | <li><strong>path</strong> (<em>string/unicode</em>) – path relative to the <em>service_name</em> where we are interested in the list of available snapshots</li> | |
372 | </ul> | |
373 | </td> | |
374 | </tr> | |
375 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A list of python <em>datetime.DateTime</em> instances in GMT/UTC time zone</p> | |
376 | </td> | |
293 | 377 | </tr> |
294 | 378 | </tbody> |
295 | 379 | </table> |
346 | 430 | <dt id="smb.SMBProtocol.SMBProtocolFactory.retrieveFile"> |
347 | 431 | <tt class="descname">retrieveFile</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>file_obj</em>, <em>timeout=30</em><big>)</big><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.retrieveFile"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.retrieveFile" title="Permalink to this definition">¶</a></dt> |
348 | 432 | <dd><p>Retrieve the contents of the file at <em>path</em> on the <em>service_name</em> and write these contents to the provided <em>file_obj</em>.</p> |
433 | <p>Use <em>retrieveFileFromOffset()</em> method if you need to specify the offset to read from the remote <em>path</em> and/or the maximum number of bytes to write to the <em>file_obj</em>.</p> | |
349 | 434 | <p>The meaning of the <em>timeout</em> parameter will be different from other file operation methods. As the downloaded file usually exceeeds the maximum size |
350 | 435 | of each SMB/CIFS data message, it will be packetized into a series of request messages (each message will request about about 60kBytes). |
351 | 436 | The <em>timeout</em> parameter is an integer/float value that specifies the timeout interval for these individual SMB/CIFS message to be transmitted and downloaded from the remote SMB/CIFS server.</p> |
356 | 441 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> |
357 | 442 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> |
358 | 443 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file cannot be opened for reading, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be called in the returned <em>Deferred</em> errback.</li> |
359 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> until EOF is received from the remote service.</li> | |
360 | </ul> | |
361 | </td> | |
362 | </tr> | |
363 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A <em>twisted.internet.defer.Deferred</em> instance. The callback function will be called with a 3-element tuple of ( <em>file_obj</em>, file attributes of the file on server, number of bytes retrieved ). | |
444 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> until EOF is received from the remote service. In Python3, this file-like object must have a <em>write</em> method which accepts a bytes parameter.</li> | |
445 | </ul> | |
446 | </td> | |
447 | </tr> | |
448 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A <em>twisted.internet.defer.Deferred</em> instance. The callback function will be called with a 3-element tuple of ( <em>file_obj</em>, file attributes of the file on server, number of bytes written to <em>file_obj</em> ). | |
449 | The file attributes is an integer value made up from a bitwise-OR of <em>SMB_FILE_ATTRIBUTE_xxx</em> bits (see smb_constants.py)</p> | |
450 | </td> | |
451 | </tr> | |
452 | </tbody> | |
453 | </table> | |
454 | </dd></dl> | |
455 | ||
456 | <dl class="method"> | |
457 | <dt id="smb.SMBProtocol.SMBProtocolFactory.retrieveFileFromOffset"> | |
458 | <tt class="descname">retrieveFileFromOffset</tt><big>(</big><em>service_name</em>, <em>path</em>, <em>file_obj</em>, <em>offset=0</em>, <em>max_length=-1</em>, <em>timeout=30</em><big>)</big><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.retrieveFileFromOffset" title="Permalink to this definition">¶</a></dt> | |
459 | <dd><p>Retrieve the contents of the file at <em>path</em> on the <em>service_name</em> and write these contents to the provided <em>file_obj</em>.</p> | |
460 | <p>The meaning of the <em>timeout</em> parameter will be different from other file operation methods. As the downloaded file usually exceeeds the maximum size | |
461 | of each SMB/CIFS data message, it will be packetized into a series of request messages (each message will request about about 60kBytes). | |
462 | The <em>timeout</em> parameter is an integer/float value that specifies the timeout interval for these individual SMB/CIFS message to be transmitted and downloaded from the remote SMB/CIFS server.</p> | |
463 | <table class="docutils field-list" frame="void" rules="none"> | |
464 | <col class="field-name" /> | |
465 | <col class="field-body" /> | |
466 | <tbody valign="top"> | |
467 | <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple"> | |
468 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> | |
469 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file cannot be opened for reading, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be called in the returned <em>Deferred</em> errback.</li> | |
470 | <li><strong>file_obj</strong> – A file-like object that has a <em>write</em> method. Data will be written continuously to <em>file_obj</em> until EOF is received from the remote service. In Python3, this file-like object must have a <em>write</em> method which accepts a bytes parameter.</li> | |
471 | <li><strong>offset</strong> (<em>integer/long</em>) – the offset in the remote <em>path</em> where the first byte will be read and written to <em>file_obj</em>. Must be either zero or a positive integer/long value.</li> | |
472 | <li><strong>max_length</strong> (<em>integer/long</em>) – maximum number of bytes to read from the remote <em>path</em> and write to the <em>file_obj</em>. Specify a negative value to read from <em>offset</em> to the EOF. | |
473 | If zero, the <em>Deferred</em> callback is invoked immediately after the file is opened successfully for reading.</li> | |
474 | </ul> | |
475 | </td> | |
476 | </tr> | |
477 | <tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first last">A <em>twisted.internet.defer.Deferred</em> instance. The callback function will be called with a 3-element tuple of ( <em>file_obj</em>, file attributes of the file on server, number of bytes written to <em>file_obj</em> ). | |
364 | 478 | The file attributes is an integer value made up from a bitwise-OR of <em>SMB_FILE_ATTRIBUTE_xxx</em> bits (see smb_constants.py)</p> |
365 | 479 | </td> |
366 | 480 | </tr> |
384 | 498 | <li><strong>service_name</strong> (<em>string/unicode</em>) – the name of the shared folder for the <em>path</em></li> |
385 | 499 | <li><strong>path</strong> (<em>string/unicode</em>) – Path of the file on the remote server. If the file at <em>path</em> does not exist, it will be created. Otherwise, it will be overwritten. |
386 | 500 | If the <em>path</em> refers to a folder or the file cannot be opened for writing, an <a class="reference internal" href="smb_exceptions.html"><em>OperationFailure</em></a> will be called in the returned <em>Deferred</em> errback.</li> |
387 | <li><strong>file_obj</strong> – A file-like object that has a <em>read</em> method. Data will read continuously from <em>file_obj</em> until EOF.</li> | |
501 | <li><strong>file_obj</strong> – A file-like object that has a <em>read</em> method. Data will read continuously from <em>file_obj</em> until EOF. In Python3, this file-like object must have a <em>read</em> method which returns a bytes parameter.</li> | |
388 | 502 | </ul> |
389 | 503 | </td> |
390 | 504 | </tr> |
393 | 507 | </tr> |
394 | 508 | </tbody> |
395 | 509 | </table> |
510 | </dd></dl> | |
511 | ||
512 | <dl class="attribute"> | |
513 | <dt id="smb.SMBProtocol.SMBProtocolFactory.SIGN_NEVER"> | |
514 | <tt class="descname">SIGN_NEVER</tt><em class="property"> = 0</em><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.SIGN_NEVER" title="Permalink to this definition">¶</a></dt> | |
515 | <dd><p>SMB messages will never be signed regardless of remote server’s configurations; access errors will occur if the remote server requires signing.</p> | |
516 | </dd></dl> | |
517 | ||
518 | <dl class="attribute"> | |
519 | <dt id="smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_REQUIRED"> | |
520 | <tt class="descname">SIGN_WHEN_REQUIRED</tt><em class="property"> = 2</em><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_REQUIRED" title="Permalink to this definition">¶</a></dt> | |
521 | <dd><p>SMB messages will only be signed when remote server requires signing.</p> | |
522 | </dd></dl> | |
523 | ||
524 | <dl class="attribute"> | |
525 | <dt id="smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_SUPPORTED"> | |
526 | <tt class="descname">SIGN_WHEN_SUPPORTED</tt><em class="property"> = 1</em><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_SUPPORTED" title="Permalink to this definition">¶</a></dt> | |
527 | <dd><p>SMB messages will be signed when remote server supports signing but not requires signing.</p> | |
396 | 528 | </dd></dl> |
397 | 529 | |
398 | 530 | <dl class="attribute"> |
405 | 537 | <dt id="smb.SMBProtocol.SMBProtocolFactory.isReady"> |
406 | 538 | <tt class="descname">isReady</tt><a class="reference internal" href="../_modules/smb/SMBProtocol.html#SMBProtocolFactory.isReady"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.isReady" title="Permalink to this definition">¶</a></dt> |
407 | 539 | <dd><p>A convenient property to return True if the underlying SMB connection has connected to remote server, has successfully authenticated itself and is ready for file operations.</p> |
540 | </dd></dl> | |
541 | ||
542 | <dl class="attribute"> | |
543 | <dt id="smb.SMBProtocol.SMBProtocolFactory.isUsingSMB2"> | |
544 | <tt class="descname">isUsingSMB2</tt><a class="headerlink" href="#smb.SMBProtocol.SMBProtocolFactory.isUsingSMB2" title="Permalink to this definition">¶</a></dt> | |
545 | <dd><p>A convenient property to return True if the underlying SMB connection is using SMB2 protocol.</p> | |
408 | 546 | </dd></dl> |
409 | 547 | |
410 | 548 | </dd></dl> |
428 | 566 | <a href="smb_SharedDevice.html" title="SharedDevice Class" |
429 | 567 | >next</a> |</li> |
430 | 568 | <li class="right" > |
431 | <a href="smb_SMBConnection.html" title="SMBConnection Class" | |
569 | <a href="smb_SMBHandler.html" title="SMbHandler Class" | |
432 | 570 | >previous</a> |</li> |
433 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
571 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
434 | 572 | </ul> |
435 | 573 | </div> |
436 | 574 | <div class="footer"> |
437 | © Copyright 2011, Michael Teo. | |
575 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
438 | 576 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
439 | 577 | </div> |
440 | 578 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>SharedDevice Class — pysmb 1.0.0 documentation</title> | |
10 | <title>SharedDevice Class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="SharedFile Class" href="smb_SharedFile.html" /> |
29 | 29 | <link rel="prev" title="SMBProtocolFactory Class" href="smb_SMBProtocolFactory.html" /> |
30 | 30 | </head> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
147 | 147 | <li class="right" > |
148 | 148 | <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class" |
149 | 149 | >previous</a> |</li> |
150 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
150 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
151 | 151 | </ul> |
152 | 152 | </div> |
153 | 153 | <div class="footer"> |
154 | © Copyright 2011, Michael Teo. | |
154 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
155 | 155 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
156 | 156 | </div> |
157 | 157 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>SharedFile Class — pysmb 1.0.0 documentation</title> | |
10 | <title>SharedFile Class — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="SMB Exceptions" href="smb_exceptions.html" /> |
29 | 29 | <link rel="prev" title="SharedDevice Class" href="smb_SharedDevice.html" /> |
30 | 30 | </head> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="smb_SharedDevice.html" title="SharedDevice Class" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
171 | 171 | <li class="right" > |
172 | 172 | <a href="smb_SharedDevice.html" title="SharedDevice Class" |
173 | 173 | >previous</a> |</li> |
174 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
174 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
175 | 175 | </ul> |
176 | 176 | </div> |
177 | 177 | <div class="footer"> |
178 | © Copyright 2011, Michael Teo. | |
178 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
179 | 179 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
180 | 180 | </div> |
181 | 181 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>SMB Exceptions — pysmb 1.0.0 documentation</title> | |
10 | <title>SMB Exceptions — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '../', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="../_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="../_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="../_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="../index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="../index.html" /> | |
28 | 28 | <link rel="next" title="Extending pysmb For Other Frameworks" href="../extending.html" /> |
29 | 29 | <link rel="prev" title="SharedFile Class" href="smb_SharedFile.html" /> |
30 | 30 | </head> |
41 | 41 | <li class="right" > |
42 | 42 | <a href="smb_SharedFile.html" title="SharedFile Class" |
43 | 43 | accesskey="P">previous</a> |</li> |
44 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
44 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
45 | 45 | </ul> |
46 | 46 | </div> |
47 | 47 | <div class="sphinxsidebar"> |
135 | 135 | <li class="right" > |
136 | 136 | <a href="smb_SharedFile.html" title="SharedFile Class" |
137 | 137 | >previous</a> |</li> |
138 | <li><a href="../index.html">pysmb 1.0.0 documentation</a> »</li> | |
138 | <li><a href="../index.html">pysmb 1.1.5 documentation</a> »</li> | |
139 | 139 | </ul> |
140 | 140 | </div> |
141 | 141 | <div class="footer"> |
142 | © Copyright 2011, Michael Teo. | |
142 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
143 | 143 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
144 | 144 | </div> |
145 | 145 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>Extending pysmb For Other Frameworks — pysmb 1.0.0 documentation</title> | |
10 | <title>Extending pysmb For Other Frameworks — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="index.html" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="index.html" /> | |
28 | 28 | <link rel="prev" title="SMB Exceptions" href="api/smb_exceptions.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
37 | 37 | <li class="right" > |
38 | 38 | <a href="api/smb_exceptions.html" title="SMB Exceptions" |
39 | 39 | accesskey="P">previous</a> |</li> |
40 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
40 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
41 | 41 | </ul> |
42 | 42 | </div> |
43 | 43 | <div class="sphinxsidebar"> |
112 | 112 | <li class="right" > |
113 | 113 | <a href="api/smb_exceptions.html" title="SMB Exceptions" |
114 | 114 | >previous</a> |</li> |
115 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
115 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
116 | 116 | </ul> |
117 | 117 | </div> |
118 | 118 | <div class="footer"> |
119 | © Copyright 2011, Michael Teo. | |
119 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
120 | 120 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
121 | 121 | </div> |
122 | 122 | </body> |
9 | 9 | <head> |
10 | 10 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
11 | 11 | |
12 | <title>Index — pysmb 1.0.0 documentation</title> | |
12 | <title>Index — pysmb 1.1.5 documentation</title> | |
13 | 13 | |
14 | 14 | <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
15 | 15 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
17 | 17 | <script type="text/javascript"> |
18 | 18 | var DOCUMENTATION_OPTIONS = { |
19 | 19 | URL_ROOT: '', |
20 | VERSION: '1.0.0', | |
20 | VERSION: '1.1.5', | |
21 | 21 | COLLAPSE_INDEX: false, |
22 | 22 | FILE_SUFFIX: '.html', |
23 | 23 | HAS_SOURCE: true |
26 | 26 | <script type="text/javascript" src="_static/jquery.js"></script> |
27 | 27 | <script type="text/javascript" src="_static/underscore.js"></script> |
28 | 28 | <script type="text/javascript" src="_static/doctools.js"></script> |
29 | <link rel="top" title="pysmb 1.0.0 documentation" href="index.html" /> | |
29 | <link rel="top" title="pysmb 1.1.5 documentation" href="index.html" /> | |
30 | 30 | </head> |
31 | 31 | <body> |
32 | 32 | <div class="related"> |
35 | 35 | <li class="right" style="margin-right: 10px"> |
36 | 36 | <a href="#" title="General Index" |
37 | 37 | accesskey="I">index</a></li> |
38 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
38 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
39 | 39 | </ul> |
40 | 40 | </div> |
41 | 41 | <div class="sphinxsidebar"> |
253 | 253 | <dt><a href="api/smb_SharedDevice.html#smb.base.SharedDevice.isTemporary">isTemporary (smb.base.SharedDevice attribute)</a> |
254 | 254 | </dt> |
255 | 255 | |
256 | ||
257 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.isUsingSMB2">isUsingSMB2 (smb.SMBConnection.SMBConnection attribute)</a> | |
258 | </dt> | |
259 | ||
260 | <dd><dl> | |
261 | ||
262 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.isUsingSMB2">(smb.SMBProtocol.SMBProtocolFactory attribute)</a> | |
263 | </dt> | |
264 | ||
265 | </dl></dd> | |
256 | 266 | </dl></td> |
257 | 267 | </tr></table> |
258 | 268 | |
293 | 303 | </dt> |
294 | 304 | |
295 | 305 | </dl></dd> |
306 | ||
307 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.listSnapshots">listSnapshots() (smb.SMBConnection.SMBConnection method)</a> | |
308 | </dt> | |
309 | ||
310 | <dd><dl> | |
311 | ||
312 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.listSnapshots">(smb.SMBProtocol.SMBProtocolFactory method)</a> | |
313 | </dt> | |
314 | ||
315 | </dl></dd> | |
296 | 316 | </dl></td> |
297 | 317 | </tr></table> |
298 | 318 | |
362 | 382 | <table style="width: 100%" class="indextable genindextable"><tr> |
363 | 383 | <td style="width: 33%" valign="top"><dl> |
364 | 384 | |
385 | <dt><a href="api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.queryIPForName">queryIPForName() (nmb.NetBIOS.NetBIOS method)</a> | |
386 | </dt> | |
387 | ||
388 | <dd><dl> | |
389 | ||
390 | <dt><a href="api/nmb_NBNSProtocol.html#nmb.NetBIOSProtocol.NBNSProtocol.queryIPForName">(nmb.NetBIOSProtocol.NBNSProtocol method)</a> | |
391 | </dt> | |
392 | ||
393 | </dl></dd> | |
394 | </dl></td> | |
395 | <td style="width: 33%" valign="top"><dl> | |
396 | ||
365 | 397 | <dt><a href="api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.queryName">queryName() (nmb.NetBIOS.NetBIOS method)</a> |
366 | 398 | </dt> |
367 | 399 | |
387 | 419 | </dt> |
388 | 420 | |
389 | 421 | </dl></dd> |
390 | </dl></td> | |
391 | <td style="width: 33%" valign="top"><dl> | |
392 | 422 | |
393 | 423 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.retrieveFile">retrieveFile() (smb.SMBConnection.SMBConnection method)</a> |
394 | 424 | </dt> |
400 | 430 | |
401 | 431 | </dl></dd> |
402 | 432 | </dl></td> |
433 | <td style="width: 33%" valign="top"><dl> | |
434 | ||
435 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.retrieveFileFromOffset">retrieveFileFromOffset() (smb.SMBConnection.SMBConnection method)</a> | |
436 | </dt> | |
437 | ||
438 | <dd><dl> | |
439 | ||
440 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.retrieveFileFromOffset">(smb.SMBProtocol.SMBProtocolFactory method)</a> | |
441 | </dt> | |
442 | ||
443 | </dl></dd> | |
444 | </dl></td> | |
403 | 445 | </tr></table> |
404 | 446 | |
405 | 447 | <h2 id="S">S</h2> |
418 | 460 | </dt> |
419 | 461 | |
420 | 462 | |
463 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.SIGN_NEVER">SIGN_NEVER (smb.SMBConnection.SMBConnection attribute)</a> | |
464 | </dt> | |
465 | ||
466 | <dd><dl> | |
467 | ||
468 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.SIGN_NEVER">(smb.SMBProtocol.SMBProtocolFactory attribute)</a> | |
469 | </dt> | |
470 | ||
471 | </dl></dd> | |
472 | ||
473 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.SIGN_WHEN_REQUIRED">SIGN_WHEN_REQUIRED (smb.SMBConnection.SMBConnection attribute)</a> | |
474 | </dt> | |
475 | ||
476 | <dd><dl> | |
477 | ||
478 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_REQUIRED">(smb.SMBProtocol.SMBProtocolFactory attribute)</a> | |
479 | </dt> | |
480 | ||
481 | </dl></dd> | |
482 | </dl></td> | |
483 | <td style="width: 33%" valign="top"><dl> | |
484 | ||
485 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.SIGN_WHEN_SUPPORTED">SIGN_WHEN_SUPPORTED (smb.SMBConnection.SMBConnection attribute)</a> | |
486 | </dt> | |
487 | ||
488 | <dd><dl> | |
489 | ||
490 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory.SIGN_WHEN_SUPPORTED">(smb.SMBProtocol.SMBProtocolFactory attribute)</a> | |
491 | </dt> | |
492 | ||
493 | </dl></dd> | |
494 | ||
421 | 495 | <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection">SMBConnection (class in smb.SMBConnection)</a> |
422 | 496 | </dt> |
423 | 497 | |
424 | </dl></td> | |
425 | <td style="width: 33%" valign="top"><dl> | |
426 | 498 | |
427 | 499 | <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory">SMBProtocolFactory (class in smb.SMBProtocol)</a> |
428 | 500 | </dt> |
477 | 549 | <li class="right" style="margin-right: 10px"> |
478 | 550 | <a href="#" title="General Index" |
479 | 551 | >index</a></li> |
480 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
552 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
481 | 553 | </ul> |
482 | 554 | </div> |
483 | 555 | <div class="footer"> |
484 | © Copyright 2011, Michael Teo. | |
556 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
485 | 557 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
486 | 558 | </div> |
487 | 559 | </body> |
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>Welcome to pysmb’s documentation! — pysmb 1.0.0 documentation</title> | |
10 | <title>Welcome to pysmb’s documentation! — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
24 | 24 | <script type="text/javascript" src="_static/jquery.js"></script> |
25 | 25 | <script type="text/javascript" src="_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="_static/doctools.js"></script> |
27 | <link rel="top" title="pysmb 1.0.0 documentation" href="#" /> | |
27 | <link rel="top" title="pysmb 1.1.5 documentation" href="#" /> | |
28 | 28 | <link rel="next" title="NBNSProtocol Class" href="api/nmb_NBNSProtocol.html" /> |
29 | 29 | </head> |
30 | 30 | <body> |
37 | 37 | <li class="right" > |
38 | 38 | <a href="api/nmb_NBNSProtocol.html" title="NBNSProtocol Class" |
39 | 39 | accesskey="N">next</a> |</li> |
40 | <li><a href="#">pysmb 1.0.0 documentation</a> »</li> | |
40 | <li><a href="#">pysmb 1.1.5 documentation</a> »</li> | |
41 | 41 | </ul> |
42 | 42 | </div> |
43 | 43 | <div class="sphinxsidebar"> |
87 | 87 | |
88 | 88 | <div class="section" id="welcome-to-pysmb-s-documentation"> |
89 | 89 | <h1>Welcome to pysmb’s documentation!<a class="headerlink" href="#welcome-to-pysmb-s-documentation" title="Permalink to this headline">¶</a></h1> |
90 | <p>pysmb is a pure Python implementation of the client-side SMB/CIFS protocol which is the underlying protocol that facilitates file sharing and printing between Windows machines, | |
91 | as well as with Linux machines via the Samba server application. | |
92 | pysmb is developed in Python 2.4.6 (and Python 2.7.1) and has been tested against shared folders on Windows XP SP3, Windows Vista, Windows 7 and Samba 3.x.</p> | |
90 | <p>pysmb is a pure Python implementation of the client-side SMB/CIFS protocol (SMB1 and SMB2) which is the underlying protocol | |
91 | that facilitates file sharing and printing between Windows machines, as well as with Linux machines via the Samba server application. | |
92 | pysmb is developed in Python 2.4.6, Python 2.7.1 and Python 3.2.3 and has been tested against shared folders on Windows XP SP3, Windows Vista, Windows 7 and Samba 3.x.</p> | |
93 | <p>The latest version of pysmb is always available at the pysmb project page at <a class="reference external" href="http://miketeo.net/wp/index.php/projects/pysmb">miketeo.net</a>.</p> | |
93 | 94 | <div class="section" id="license"> |
94 | 95 | <h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2> |
95 | 96 | <p>pysmb itself is licensed under an opensource license. |
105 | 106 | <ul class="simple"> |
106 | 107 | <li><strong>pyasn1</strong> : Pure Python implementation of ASN.1 parsing and encoding (not included together with pysmb; needs to be installed separately)</li> |
107 | 108 | <li><strong>md4</strong> and <strong>U32</strong> : Pure Python implementation of MD4 hashing algorithm and 32-bit unsigned integer by Dmitry Rozmanov. Licensed under LGPL and included together with pysmb.</li> |
108 | <li><strong>pyDes</strong> : Pure python implementation of the DES encryption algorithm by Todd Whiteman. Free domain and included together with pysmb.</li> | |
109 | <li><strong>pyDes</strong> : Pure Python implementation of the DES encryption algorithm by Todd Whiteman. Free domain and included together with pysmb.</li> | |
110 | <li><strong>sha256</strong> : Pure Python implementation of SHA-256 message digest by Thomas Dixon. Licensed under MIT and included together with pysmb. This module is imported only when | |
111 | the Python standard library (usually Python 2.4) does not provide the SHA-256 hash algorithm.</li> | |
109 | 112 | </ul> |
110 | 113 | <p>In various places, there are references to different specifications. Most of these referenced specifications |
111 | 114 | can be downloaded from Microsoft web site under Microsoft’s “Open Specification Promise”. If you need to download |
133 | 136 | <li><strong>smb/securityblob.py</strong> : |
134 | 137 | Provides routines to encode/decode the NTLMSSP security blob in the SMB messages.</li> |
135 | 138 | <li><strong>smb/smb_constants.py</strong> : |
136 | All the constants used in the smb package</li> | |
139 | All the constants used in the smb package for SMB1 protocol</li> | |
137 | 140 | <li><strong>smb/smb_structs.py</strong> : |
138 | Contains the internal classes used in the SMB package. These classes are usually used to encode/decode the parameter and data blocks of specific SMB message.</li> | |
141 | Contains the internal classes used in the SMB package for SMB1 protocol. These classes are usually used to encode/decode the parameter and data blocks of specific SMB1 message.</li> | |
142 | <li><strong>smb/smb2_constants.py</strong> : | |
143 | All the constants used in the smb package for SMB2 protocol</li> | |
144 | <li><strong>smb/smb2_structs.py</strong> : | |
145 | Contains the internal classes used in the SMB package for SMB2 protocol. These classes are usually used to encode/decode the parameter and data blocks of specific SMB2 message.</li> | |
139 | 146 | <li><strong>smb/SMBConnection.py</strong> : |
140 | 147 | Contains a SMB protocol implementation. All operations are blocking I/O.</li> |
141 | 148 | <li><strong>smb/SMBProtocol.py</strong> : |
142 | 149 | Contains the SMB protocol implementation for use in the Twisted framework.</li> |
150 | <li><strong>smb/SMBHandler.py</strong> : | |
151 | Provides support for “<a class="reference external" href="smb://">smb://</a>” URL in the urllib2 python package.</li> | |
143 | 152 | </ul> |
144 | 153 | </div> |
145 | 154 | <div class="section" id="using-pysmb"> |
157 | 166 | <li>To use pysmb in applications where you want the file operations to return after they have completed (synchronous style), please read |
158 | 167 | <a class="reference internal" href="api/smb_SMBConnection.html"><em>smb.SMBConnection.SMBConnection</em></a> documentation.</li> |
159 | 168 | <li>To use pysmb in Twisted, please read <a class="reference internal" href="api/smb_SMBProtocolFactory.html"><em>smb.SMBProtocol.SMBProtocolFactory</em></a> documentation.</li> |
169 | <li>To support “<a class="reference external" href="smb://">smb://</a>” URL in urllib2 python package, read <a class="reference internal" href="api/smb_SMBHandler.html"><em>smb.SMBHandler.SMBHandler</em></a> documentation.</li> | |
160 | 170 | </ul> |
161 | 171 | </dd> |
162 | 172 | <dt>As a software developer who is looking to modify pysmb so that you can integrate it to other network frameworks:</dt> |
173 | 183 | <li class="toctree-l1"><a class="reference internal" href="api/nmb_NBNSProtocol.html">NBNSProtocol Class</a></li> |
174 | 184 | <li class="toctree-l1"><a class="reference internal" href="api/nmb_NetBIOS.html">NetBIOS class</a></li> |
175 | 185 | <li class="toctree-l1"><a class="reference internal" href="api/smb_SMBConnection.html">SMBConnection Class</a></li> |
186 | <li class="toctree-l1"><a class="reference internal" href="api/smb_SMBHandler.html">SMbHandler Class</a></li> | |
176 | 187 | <li class="toctree-l1"><a class="reference internal" href="api/smb_SMBProtocolFactory.html">SMBProtocolFactory Class</a></li> |
177 | 188 | <li class="toctree-l1"><a class="reference internal" href="api/smb_SharedDevice.html">SharedDevice Class</a></li> |
178 | 189 | <li class="toctree-l1"><a class="reference internal" href="api/smb_SharedFile.html">SharedFile Class</a></li> |
201 | 212 | <li class="right" > |
202 | 213 | <a href="api/nmb_NBNSProtocol.html" title="NBNSProtocol Class" |
203 | 214 | >next</a> |</li> |
204 | <li><a href="#">pysmb 1.0.0 documentation</a> »</li> | |
215 | <li><a href="#">pysmb 1.1.5 documentation</a> »</li> | |
205 | 216 | </ul> |
206 | 217 | </div> |
207 | 218 | <div class="footer"> |
208 | © Copyright 2011, Michael Teo. | |
219 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
209 | 220 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
210 | 221 | </div> |
211 | 222 | </body> |
Binary diff not shown
7 | 7 | <head> |
8 | 8 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
9 | 9 | |
10 | <title>Search — pysmb 1.0.0 documentation</title> | |
10 | <title>Search — pysmb 1.1.5 documentation</title> | |
11 | 11 | |
12 | 12 | <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" /> |
13 | 13 | <link rel="stylesheet" href="_static/pygments.css" type="text/css" /> |
15 | 15 | <script type="text/javascript"> |
16 | 16 | var DOCUMENTATION_OPTIONS = { |
17 | 17 | URL_ROOT: '', |
18 | VERSION: '1.0.0', | |
18 | VERSION: '1.1.5', | |
19 | 19 | COLLAPSE_INDEX: false, |
20 | 20 | FILE_SUFFIX: '.html', |
21 | 21 | HAS_SOURCE: true |
25 | 25 | <script type="text/javascript" src="_static/underscore.js"></script> |
26 | 26 | <script type="text/javascript" src="_static/doctools.js"></script> |
27 | 27 | <script type="text/javascript" src="_static/searchtools.js"></script> |
28 | <link rel="top" title="pysmb 1.0.0 documentation" href="index.html" /> | |
28 | <link rel="top" title="pysmb 1.1.5 documentation" href="index.html" /> | |
29 | 29 | <script type="text/javascript"> |
30 | 30 | jQuery(function() { Search.loadIndex("searchindex.js"); }); |
31 | 31 | </script> |
39 | 39 | <li class="right" style="margin-right: 10px"> |
40 | 40 | <a href="genindex.html" title="General Index" |
41 | 41 | accesskey="I">index</a></li> |
42 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
42 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
43 | 43 | </ul> |
44 | 44 | </div> |
45 | 45 | <div class="sphinxsidebar"> |
87 | 87 | <li class="right" style="margin-right: 10px"> |
88 | 88 | <a href="genindex.html" title="General Index" |
89 | 89 | >index</a></li> |
90 | <li><a href="index.html">pysmb 1.0.0 documentation</a> »</li> | |
90 | <li><a href="index.html">pysmb 1.1.5 documentation</a> »</li> | |
91 | 91 | </ul> |
92 | 92 | </div> |
93 | 93 | <div class="footer"> |
94 | © Copyright 2011, Michael Teo. | |
94 | © Copyright 2001-2013, Michael Teo http://miketeo.net/. | |
95 | 95 | Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2. |
96 | 96 | </div> |
97 | 97 | </body> |
0 | Search.setIndex({objects:{"nmb.NetBIOS":{NetBIOS:[1,1,1,""]},"nmb.NetBIOSProtocol":{NBNSProtocol:[8,1,1,""],NetBIOSTimeout:[8,1,1,""]},"smb.SMBProtocol":{SMBProtocolFactory:[4,1,1,""]},"nmb.NetBIOSProtocol.NBNSProtocol":{queryName:[8,2,1,""],"__init__":[8,2,1,""]},"smb.base":{SharedDevice:[2,1,1,""],NotReadyError:[6,1,1,""],SharedFile:[3,1,1,""],SMBTimeout:[6,1,1,""],NotConnectedError:[6,1,1,""]},"smb.SMBConnection.SMBConnection":{rename:[7,2,1,""],deleteDirectory:[7,2,1,""],deleteFiles:[7,2,1,""],retrieveFile:[7,2,1,""],listPath:[7,2,1,""],storeFile:[7,2,1,""],connect:[7,2,1,""],close:[7,2,1,""],createDirectory:[7,2,1,""],echo:[7,2,1,""],listShares:[7,2,1,""],"__init__":[7,2,1,""]},"smb.base.SharedFile":{short_name:[3,0,1,""],last_access_time:[3,0,1,""],last_attr_change_time:[3,0,1,""],last_write_time:[3,0,1,""],file_attributes:[3,0,1,""],filename:[3,0,1,""],isDirectory:[3,0,1,""],create_time:[3,0,1,""],file_size:[3,0,1,""],alloc_size:[3,0,1,""]},"smb.SMBProtocol.SMBProtocolFactory":{rename:[4,2,1,""],deleteDirectory:[4,2,1,""],isReady:[4,0,1,""],retrieveFile:[4,2,1,""],onAuthFailed:[4,2,1,""],listShares:[4,2,1,""],listPath:[4,2,1,""],instance:[4,0,1,""],closeConnection:[4,2,1,""],storeFile:[4,2,1,""],onAuthOK:[4,2,1,""],createDirectory:[4,2,1,""],echo:[4,2,1,""],deleteFiles:[4,2,1,""],"__init__":[4,2,1,""]},"smb.SMBConnection":{SMBConnection:[7,1,1,""]},"nmb.NetBIOS.NetBIOS":{close:[1,2,1,""],queryName:[1,2,1,""],"__init__":[1,2,1,""]},"smb.smb_structs":{UnsupportedFeature:[6,1,1,""],ProtocolError:[6,1,1,""],OperationFailure:[6,1,1,""]},"smb.base.SharedDevice":{isSpecial:[2,0,1,""],type:[2,0,1,""],comments:[2,0,1,""],isTemporary:[2,0,1,""],name:[2,0,1,""]}},terms:{all:[4,0,7],queri:[4,0,8,1,7],follow:[0,2],whose:0,accur:4,depend:0,listen_port:[1,8],netbiostimeout:8,service_nam:[4,7],send:[4,1,8,7],those:4,under:0,last_write_tim:3,sourc:[0,1,2,3,4,6,7,8],string:[1,2,3,4,7,8],fals:[1,7,8],util:4,mechan:[4,7],failur:8,administr:2,list:[4,0,8,1,7],upload:[4,7],smb:[0,1,2,3,4,5,6,7],"try":[4,5,7],concurr:[4,7],ddd:[1,8],pleas:0,batch:4,deletedirectori:[4,7],zero:[1,8],nbn:[1,0],pass:[4,7],sock_famili:7,port:[1,7,8],index:0,what:[4,1,7,8,5],sub:[4,7],repli:[4,1,8,7],section:0,invok:7,access:3,delet:[4,7],u32:0,"new":[4,1,7,5],method:[1,3,4,5,7,8],hash:0,gener:5,my_nam:[4,7],lgpl:0,modif:3,address:[1,0,8,5],path:[4,7],modifi:0,sinc:3,valu:[4,7,3],wait:[4,1,8,6],search:[4,0,7],queue:4,credit:0,nmb:[1,0,8],implement:[4,0,8,5],stoplisten:8,ipc:2,via:[4,0,8,3],ntlmv2:[4,0,7],ntlmv1:[4,0,7],defer:[4,7,8],appli:[4,7],modul:0,filenam:[4,7,3],"boolean":[4,1,8,7],listshar:[4,7],instal:0,total:3,establish:[4,7],select:[4,1,8,7],from:[0,1,4,5,7,8],describ:[5,7],commun:[4,0,2],call:[1,3,4,5,7,8],type:2,until:[4,1,7],more:[4,0,7,3,5],sort:7,relat:0,sambda:[4,7],flag:[4,1,8],accept:[4,5],known:[4,7],must:[4,7,8],none:[1,2,3,4,6,7],retriev:[4,7],setup:[4,1,8,5],dmitri:0,archiv:[4,7],can:[0,1,2,4,5,7,8],caveat:[4,7],learn:[4,7],purpos:0,overrid:[4,5],meant:7,process:5,share:[4,0,7,3,2],sharedfil:[4,0,3,7],indic:[4,0,8,1,7],want:[4,0],opensourc:0,unsign:0,occur:6,addcallback:[4,8],multipl:[4,7],secur:0,write:[4,5,7],pure:0,reject:[4,7],onauthfail:[4,5],old_path:[4,7],dialect:0,resourc:[4,1,3,7],referenc:0,sp3:0,befor:[4,7],wrong:5,mai:[4,7],smb_ext_file_attr:3,data:[4,0,7,5],alloc:3,"short":3,attempt:7,bind:[1,8],credenti:[4,7],correspond:3,element:[4,7],inform:[3,2],allow:[4,7,8],origin:[4,7,3],over:0,file_s:3,held:7,through:4,paramet:[0,1,4,5,7,8],style:0,disconnect:[4,7,6],window:[4,0,3,7],persist:2,hidden:[4,7],main:0,might:4,shareddevic:[4,0,7,2],non:[4,7],within:[4,0,7],"return":[0,1,2,3,4,7,8],thei:0,handl:[4,5],auto:[4,7],safe:[4,7],initi:[5,2],framework:[4,0,8,5],promis:0,facilit:0,now:5,choic:[4,7],term:0,name:[0,1,2,3,4,7,8],ntlm:[4,0,5],authent:[4,0,7,6,5],separ:0,isreadi:4,mode:[1,8],timeout:[4,1,8,6,7],each:[4,1,7,3,2],unicod:[4,7,3,2],side:0,errback:[4,7,8],prohibit:3,domain:[4,0,7],smbtimeout:[4,6],individu:4,instiant:[1,8],continu:[4,7],connect:[4,5,6,7],todd:0,special:2,out:[4,7],network:[4,0,8,1,7],"3rd":0,space:[4,7],ntlmssp:0,content:[4,0,7],suitabl:[0,7],rel:[4,7],internet:[4,8],print:0,forth:2,factori:4,after:[4,0,8,1,7],querynam:[1,8],guess:[4,7],free:[1,0,8],standard:[1,8],base:[0,2,3,4,5,6,7],connecttcp:4,releas:[1,7],"byte":[4,7,3],earliest:4,asn:0,md4:0,care:5,english:[4,7],last_access_tim:3,could:[0,3],synchron:[0,5],success:[5,7],keep:7,filter:[4,7],length:3,place:0,oper:[0,1,4,5,6,7],softwar:0,directli:[4,3],onc:[4,5],number:[4,1,8,3,7],yourself:0,done:[1,8],messag:[4,0,6],path_file_pattern:[4,7],open:[4,0,7],size:[4,3],differ:[4,0,7,5],notreadyerror:[4,6],licens:0,system:[4,7],least:7,too:7,termin:[4,7],conveni:[4,3],store:[4,7,3],listen:[1,8],udp:[1,8],copi:0,specifi:[4,1,8],broadcast:[1,8],part:5,pars:0,than:[4,7],aaa:[1,8],target:[1,8],provid:[0,1,4,5,7,8],remov:8,second:[4,1,8,3],charact:[4,7,3],project:[4,8],reus:4,seri:4,comput:[4,7],ani:[4,0,1,3,7],download:[4,0],netbiossess:0,have:[7,0,8,5],close:[4,1,7],need:[4,0,7,3,5],bitwis:[4,7],callback:[4,5,8],self:[4,5],comm_devic:2,click:[4,7],note:[4,7],also:2,exampl:[4,0],take:[0,5],which:[0,1,3,4,5,7,8],transmit:4,singl:[4,7,2],unless:[1,8],usernam:[4,7],who:[4,0,7],smb_file_attribute_xxx:[4,7],most:[4,0,7,5],regular:[4,7],smbprotocolfactori:[4,0,3],"class":[0,1,2,3,4,5,6,7,8],smbconnect:[0,7],renam:[4,7],request:[4,7],doe:[4,7,3],wildcard:[4,7],microsoft:0,dot:[1,8],reactor:[4,8],netbiosprotocol:[0,8],session:[0,5],identifi:[4,7],find:[4,5,7],involv:5,current:6,onli:[4,7],configur:[4,7],should:[4,1,8,3,7],folder:[4,0,3,7],local:[4,7],hope:[1,8],overwritten:[4,7],disk_tre:2,listenudp:8,variou:0,familiar:0,interprocess:2,cannot:[4,7],report:5,requir:[4,7,6],enabl:[4,7],organ:0,"public":4,remot:[1,2,3,4,5,7],integr:[0,2],contain:[4,0,7,3,2],feeddata:5,where:[4,0,3,7],respond:7,proce:4,packet:[4,1,8,5],deletefil:[4,7],see:[4,7,3],sec:4,result:[4,7,8],respons:6,fail:[4,5,6,7],reserv:2,asynchron:[5,8,7],detect:[4,7],new_path:[4,7],pattern:[4,7],written:[4,7],smb_constant:[4,0,7],between:0,"import":[4,0],across:[4,7],attribut:[4,7,3],extend:[0,5],entir:4,come:0,both:[4,7],last:3,admin:2,alon:0,against:0,etc:4,instanc:[4,1,8,3,7],onnmbsessionfail:5,freeli:[4,7],comment:2,technic:5,instanti:[1,8,3],last_attr_change_tim:3,period:4,except:[4,0,8,6],securityblob:0,onauthok:[4,5],rozmanov:0,short_nam:3,devic:[3,2],bbb:[1,8],been:[4,0,7,6,5],compon:[4,7],operationfailur:[4,7,6],interest:[4,7],use_ntlm_v2:[4,5,7],smb_struct:[0,6],thousand:4,wish:[1,7],togeth:0,present:6,"case":4,look:0,packag:0,servic:[4,0,7,1,5],properti:[4,7,3],commerci:0,defin:[1,8],"while":6,abov:5,error:[5,7],loop:5,readi:[4,6],alloc_s:3,tabl:0,henc:[4,0,7],site:0,itself:[4,0],incom:8,"__init__":[4,1,7,8,5],precis:4,isdirectori:3,develop:[0,3,7],welcom:0,perform:[1,5,8,7],parti:0,isspeci:2,same:[4,7],python:0,decod:0,create_tim:3,document:0,conflict:0,complet:[4,0,6,7],closeconnect:4,keepal:7,rais:[4,8,6],temporari:2,user:[4,7,2],protocolerror:6,chang:3,excee:4,nbnsprotocol:[1,0,8],appropri:[1,8],entri:3,well:0,without:[0,8],command:[4,7],thi:[0,1,2,3,4,5,7,8],choos:[4,7],file_obj:[4,7],sequenti:7,ccc:[1,8],usual:[4,0,7,3,5],protocol:[0,6],just:[4,8],createdirectori:[4,7],tcp:[4,5],notconnectederror:[4,6],touch:[4,1,8],yet:6,iana:[1,8],storefil:[4,7],web:0,samba:0,expos:4,remote_nam:[4,5,7],add:[4,8],discret:0,blob:0,exercis:0,els:[4,7],match:[1,8],applic:[4,0,1,3,8],around:8,read:[4,0,7,5],know:[4,1,8],bit:[4,0,7],password:[4,7],like:[4,7],specif:0,integ:[0,1,3,4,7,8],server:[0,2,3,4,5,7],print_queu:2,page:[0,5],underli:[4,0,1,6,7],encount:[7,3],right:[4,7],old:[4,7],often:5,acknowledg:4,interv:4,linux:0,some:[0,7],intern:[4,0,5],istemporari:2,successfulli:[4,7],transport:[4,0,8],smbprotocol:[4,0,3],avoid:4,subclass:[4,5],buffer:5,retri:4,leav:[4,1,8,7],ipv4:1,pysmb:[0,4,5,6,7,8],refer:[4,0,7,2],machin:[4,0,8,1,7],object:[4,7],workgroup:[4,7],atttempt:7,step:5,loseconnect:4,post:[4,5],impos:[4,7],proceed:[4,7],about:[4,7,3,2],actual:7,socket:[1,5,7],idl:7,pymsb:4,constructor:5,mean:4,pyasn1:0,block:[1,0,8,7],routin:0,client:[4,0,7],own:[4,0,5],"float":[4,1,8,3],encod:0,automat:[1,8],due:5,empti:[4,1,8,3,7],wrap:8,opportun:4,your:[0,1,3,4,5,7,8],transfer:[4,0],support:[4,0,6,7],"long":[4,7,3],smb_messag:6,start:[7,8],includ:[0,5],"function":[4,0,8],creation:[3,2],tupl:[4,7],whiteman:0,translat:0,"true":[1,2,3,4,7,8],notat:[1,8,3],made:[4,0,7],cif:[0,1,3,4,5,6,7],possibl:0,whether:[4,7],pyde:0,maximum:[4,7],"60kbyte":4,limit:[4,7,3],otherwis:[4,7],listpath:[4,7,3],netbio:[0,1,4,5,7,8],credienti:4,featur:6,constant:[0,2],creat:[4,1,7,8,5],cover:0,"abstract":0,unsupportedfeatur:6,twist:[4,0,8],incomplet:5,exist:[4,7],file:[0,2,3,4,5,7],echo:[4,7],again:8,vista:[4,0,7],encrypt:0,googl:0,retrievefil:[4,7],when:[1,4,5,6,7,8],detail:[0,3,5],data_buf:6,"default":[4,7],other:[4,0,5],test:0,you:[0,1,3,4,5,7,8],functionl:4,determin:[1,0,8],file_attribut:3,authenthent:4,briefli:5,receiv:[4,1,8,7],eof:[4,7],algorithm:[4,0,7,5],directori:[4,7,3],descript:[0,2],alphanumer:[4,7],pathnam:[4,7],time:[4,0,7,3,2]},objtypes:{"0":"py:attribute","1":"py:class","2":"py:method"},titles:["Welcome to pysmb’s documentation!","NetBIOS class","SharedDevice Class","SharedFile Class","SMBProtocolFactory Class","Extending pysmb For Other Frameworks","SMB Exceptions","SMBConnection Class","NBNSProtocol Class"],objnames:{"0":["py","attribute","Python attribute"],"1":["py","class","Python class"],"2":["py","method","Python method"]},filenames:["index","api/nmb_NetBIOS","api/smb_SharedDevice","api/smb_SharedFile","api/smb_SMBProtocolFactory","extending","api/smb_exceptions","api/smb_SMBConnection","api/nmb_NBNSProtocol"]})⏎ | |
0 | Search.setIndex({objects:{"nmb.NetBIOS":{NetBIOS:[4,1,1,""]},"nmb.NetBIOSProtocol":{NBNSProtocol:[9,1,1,""],NetBIOSTimeout:[9,1,1,""]},"smb.SMBProtocol":{SMBProtocolFactory:[8,1,1,""]},"nmb.NetBIOS.NetBIOS":{close:[4,2,1,""],queryName:[4,2,1,""],"__init__":[4,2,1,""],queryIPForName:[4,2,1,""]},"smb.base":{NotConnectedError:[6,1,1,""],SharedFile:[3,1,1,""],SMBTimeout:[6,1,1,""],NotReadyError:[6,1,1,""],SharedDevice:[1,1,1,""]},"smb.SMBConnection.SMBConnection":{rename:[7,2,1,""],deleteDirectory:[7,2,1,""],listSnapshots:[7,2,1,""],retrieveFileFromOffset:[7,2,1,""],deleteFiles:[7,2,1,""],listShares:[7,2,1,""],SIGN_WHEN_SUPPORTED:[7,0,1,""],SIGN_NEVER:[7,0,1,""],echo:[7,2,1,""],retrieveFile:[7,2,1,""],storeFile:[7,2,1,""],connect:[7,2,1,""],close:[7,2,1,""],createDirectory:[7,2,1,""],SIGN_WHEN_REQUIRED:[7,0,1,""],listPath:[7,2,1,""],"__init__":[7,2,1,""],isUsingSMB2:[7,0,1,""]},"smb.base.SharedFile":{short_name:[3,0,1,""],last_write_time:[3,0,1,""],last_attr_change_time:[3,0,1,""],last_access_time:[3,0,1,""],file_attributes:[3,0,1,""],filename:[3,0,1,""],isDirectory:[3,0,1,""],create_time:[3,0,1,""],file_size:[3,0,1,""],alloc_size:[3,0,1,""]},"smb.SMBProtocol.SMBProtocolFactory":{rename:[8,2,1,""],deleteDirectory:[8,2,1,""],SIGN_WHEN_SUPPORTED:[8,0,1,""],onAuthFailed:[8,2,1,""],retrieveFileFromOffset:[8,2,1,""],listSnapshots:[8,2,1,""],retrieveFile:[8,2,1,""],listShares:[8,2,1,""],isReady:[8,0,1,""],SIGN_NEVER:[8,0,1,""],listPath:[8,2,1,""],instance:[8,0,1,""],closeConnection:[8,2,1,""],SIGN_WHEN_REQUIRED:[8,0,1,""],onAuthOK:[8,2,1,""],storeFile:[8,2,1,""],createDirectory:[8,2,1,""],echo:[8,2,1,""],deleteFiles:[8,2,1,""],"__init__":[8,2,1,""],isUsingSMB2:[8,0,1,""]},"smb.SMBConnection":{SMBConnection:[7,1,1,""]},"nmb.NetBIOSProtocol.NBNSProtocol":{queryName:[9,2,1,""],"__init__":[9,2,1,""],queryIPForName:[9,2,1,""]},"smb.smb_structs":{UnsupportedFeature:[6,1,1,""],ProtocolError:[6,1,1,""],OperationFailure:[6,1,1,""]},"smb.base.SharedDevice":{isSpecial:[1,0,1,""],type:[1,0,1,""],comments:[1,0,1,""],isTemporary:[1,0,1,""],name:[1,0,1,""]}},terms:{all:[8,0,7],code:2,jason:[4,9],illustr:[8,7,2],queri:[4,0,8,9,7],overrid:[8,5],follow:[8,0,2,7,1],whose:0,accur:8,depend:0,listen_port:[4,9],netbiostimeout:9,service_nam:[8,7],specif:0,send:[4,8,9,7],present:6,under:0,sha256:0,arbitari:[8,7],fh2:2,last_write_tim:3,sourc:[0,1,3,4,6,7,8,9],string:[8,1,2,3,4,7,9],fals:[4,8,9,7],util:[8,7],mechan:[8,7],fileretriev:8,failur:9,miketeo:0,administr:1,list:[4,0,8,9,7],upload:[8,7,2],smb:[0,1,2,3,4,5,6,7,8],"try":[8,5,7],upload_fil:2,session:[0,5],refer:[8,0,7,1],pleas:0,sign_when_requir:[8,7],direct:[8,7],sign:[8,7],deletedirectori:[8,7],zero:[4,8,9,7],nbn:[4,0],pass:[8,7,2],sock_famili:7,client_machine_nam:[8,7],port:[4,8,9,7],compat:[8,7],index:0,what:[4,8,7,9,5],sub:[8,7],repli:[4,8,9,7],section:0,"while":6,access:[8,7,3],delet:[8,7,2],version:0,u32:0,"new":[4,8,7,5],net:0,method:[8,2,3,4,5,7,9],urlerror:2,hash:0,gener:5,never:[8,7],my_nam:[8,7],lgpl:0,modif:3,address:[4,0,2,9,5],path:[8,7,2],modifi:0,sinc:3,valu:[8,7,3],wait:[4,8,9,6],search:[8,0,7],zone:[8,7],overwritten:[8,7],step:5,queue:8,credit:0,loseconnect:8,implement:[0,4,5,7,8,9],stoplisten:9,ipc:1,via:[8,0,9,3],regardless:[8,7],ntlmv2:[8,0,7],ntlmv1:[8,0,7],appli:[8,7],modul:[8,0,7],filenam:[8,7,3],"boolean":[4,8,9,7],listshar:[8,7],instal:[8,0,7],total:3,establish:[8,7],select:[4,8,9,7],from:[0,2,4,5,7,8,9],describ:[5,7],commun:[8,0,7,1],call:[8,3,4,5,7,9],handl:[8,5],type:1,until:[4,8,7],more:[8,0,7,3,5],sort:7,relat:0,sambda:[8,7],flag:[4,8,9,7],accept:[8,5,7],known:[8,7],actual:7,must:[8,7,9],none:[8,1,3,4,6,7,9],retriev:[8,7,2],setup:[4,8,9,5],dmitri:0,kwarg:8,can:[0,1,2,4,5,7,8,9],caveat:[8,7],learn:[8,7],purpos:0,def:8,control:[8,7],defer:[8,9],process:[5,2],share:[0,1,2,3,8,7],sharedfil:[8,0,3,7],indic:[4,0,8,9,7],want:[8,0],opensourc:0,unsign:0,occur:[8,7,6],addcallback:[8,9],alwai:0,multipl:[8,7],secur:0,namedtemporaryfil:[8,7],snippet:2,"__init__":[4,8,7,9,5],pure:0,reject:[8,7],onauthfail:[8,5],simpl:[8,7],old_path:[8,7],dialect:0,resourc:[4,8,3,7],remote_nam:[8,5,7],referenc:0,after:[4,0,8,9,7],befor:[8,7],wrong:5,mai:[8,7],end:[8,7],smb_ext_file_attr:3,data:[8,0,2,7,5],alloc:3,"short":3,attempt:7,bind:[4,9],credenti:[8,7],correspond:3,element:[8,7],callback:[8,5,9],allow:[8,7,9],fallback:[8,7],origin:[8,7,3],over:[8,0,7],file_s:[8,3],held:7,through:8,digest:0,paramet:[0,2,4,5,7,8,9],write:[8,5,7],style:0,disconnect:[8,7,6],window:[8,0,2,3,7],persist:1,hidden:[8,7],main:0,might:[8,7],shareddevic:[8,0,7,1],non:[8,7],"float":[4,8,9,3],"return":[0,1,2,3,4,7,8,9],thei:0,python:[8,0,2,7],auto:[8,7],safe:[8,7],initi:[5,1],dat:2,framework:[8,0,9,5],promis:0,facilit:0,pyde:0,now:5,myuserid:2,choic:[8,7],term:0,name:[0,1,2,3,4,7,8,9],edit:[8,7],ntlm:[8,0,5],userid:[8,7],authent:[8,0,7,6,5],separ:0,mode:[4,9],timeout:[4,8,9,6,7],each:[4,8,7,3,1],done:[4,9],unicod:[8,7,2,3,1],side:0,errback:[8,9],prohibit:3,domain:[8,0,7],smbtimeout:[8,6],individu:8,instiant:[4,9],continu:[8,7],connect:[8,5,6,7],todd:0,special:1,out:[8,7],network:[4,0,8,9,7],"3rd":0,space:[8,7],ntlmssp:0,content:[8,0,7],suitabl:[0,7],rel:[8,7],internet:[8,9],print:[8,0],determin:[4,0,8,9,7],forth:1,factori:8,sp3:0,insid:[8,7],querynam:[4,9],guess:[8,7],free:[4,0,9],standard:[4,0,9],base:[0,1,3,8,5,6,7],connecttcp:8,releas:[4,7],"byte":[8,7,3],earliest:8,asn:0,md4:0,care:5,last_access_tim:3,could:[0,3],synchron:[0,5],keep:7,filter:[8,7],length:3,place:0,first:[8,7,2],oper:[0,4,5,6,7,8],softwar:0,directli:[8,3],enterpris:[8,7],onc:[8,5],number:[4,8,9,3,7],yourself:0,"\u5783\u573e\u6587\u4ef6":2,messag:[8,0,6,7],path_file_pattern:[8,7],open:[8,0,2,7],size:[8,3],differ:[8,0,7,5],notreadyerror:[8,6],licens:0,system:[8,7],least:7,max_length:[8,7],too:7,termin:[8,7],conveni:[8,7,3],store:[8,7,3],listen:[4,9],udp:[4,9],copi:[8,0,7],specifi:[4,8,9,7],broadcast:[4,9],part:5,pars:0,packet:[4,8,9,5],than:[8,7],aaa:[4,9],target:[4,9],provid:[0,2,4,5,7,8,9],remov:9,second:[4,8,9,3],charact:[8,7,2,3],project:[8,0,9],reus:8,sign_nev:[8,7],posit:[8,7],other:[8,0,5],seri:8,"function":[4,0,8,9],comput:[8,7],well:0,respons:6,smb2:[8,0,7],ani:[4,0,8,3,7],smb1:[8,0,7],download:[8,0],netbiossess:0,have:[8,0,7,9,5],reserv:1,need:[0,2,3,8,5,7],smb2_constant:0,seek:[8,7],packag:[0,2],bitwis:[8,7],inform:[3,1],support_smb2:[8,7],self:[8,5],comm_devic:1,click:[8,7],note:[8,7,2],also:[8,7,1],without:[0,9],take:[0,5],which:[0,3,4,5,7,8,9],transmit:8,mit:0,singl:[8,7,1],begin:[8,7],unless:[4,9],usernam:[8,7],who:[8,0,7],smb_file_attribute_xxx:[8,7],most:[8,0,7,5],regular:[8,7],smbprotocolfactori:[8,0,3],"class":[0,1,2,3,4,5,6,7,8,9],smbconnect:[0,7],renam:[8,7],url:[0,2],request:[8,7],doe:[8,0,3,7],snapshot:[8,7],wildcard:[8,7],neg:[8,7],usual:[8,0,7,3,5],microsoft:0,dot:[4,9],reactor:[8,9],netbiosprotocol:[0,9],server_nam:[8,7],concurr:[8,7],protocol:[8,0,6,7],find:[8,5,7],involv:5,current:6,onli:[8,0,2,7],configur:[8,7],should:[4,8,9,3,7],busi:[8,7],folder:[8,0,2,3,7],local:[8,7],hope:[4,9],meant:7,disk_tre:1,listenudp:9,contribut:[4,9],variou:0,notat:[4,9,3],familiar:0,interprocess:1,cannot:[8,7,2],listsnapshot:[8,7],requir:[8,7,6],enabl:[8,7],organ:0,queryipfornam:[4,9],"public":8,sha:0,integr:[0,1],contain:[0,1,3,4,7,8],feeddata:5,where:[8,0,3,7],respond:7,set:[8,7],rfc1001:[8,7,2],deletefil:[8,7],see:[8,7,3],sec:8,result:[8,7,9],arg:8,fail:[8,5,6,7],close:[4,8,2,7],"60kbyte":8,detect:[8,7],new_path:[8,7],extend:[0,5],pattern:[8,7],user:[8,7,1],retrievefilefromoffset:[8,7],written:[8,7],smb_constant:[8,0,7],between:0,"import":[8,0,2,7],across:[8,7],attribut:[8,7,3],parent:2,tempfil:[8,7],sign_opt:[8,7],entir:8,come:0,both:[8,7],last:3,is_direct_tcp:[8,7],admin:1,alon:0,against:0,constructor:5,etc:8,instanc:[4,8,9,3,7],onnmbsessionfail:5,freeli:[8,7],isusingsmb2:[8,7],comment:1,simpli:2,technic:5,point:2,instanti:[4,8,9,3],"\u6d4b\u8bd5\u6587\u4ef6\u5939":2,last_attr_change_tim:3,period:8,except:[8,0,9,6],securityblob:0,onauthok:[8,5],wider:[8,7],ultim:[8,7],rozmanov:0,short_nam:3,devic:[3,1],isreadi:8,been:[8,0,7,6,5],compon:[8,7,2],operationfailur:[8,7,6],interest:[8,7],immedi:[8,7],use_ntlm_v2:[8,5,7],blob:0,smb_struct:[8,0,6,7],thousand:8,assert:7,togeth:0,those:8,"case":8,look:0,sign_when_support:[8,7],servic:[4,0,8,7,5],properti:[8,7,3],batch:8,defin:[4,9],invok:[8,7],abov:5,error:[8,5,7],report:5,gmt:[8,7],loop:5,readi:[8,6],alloc_s:3,tabl:0,henc:[8,0,7],site:0,archiv:[8,7],incom:9,ascii:[8,7],conn:7,precis:8,isdirectori:3,develop:[0,3,7],welcom:0,datetim:[8,7],perform:[4,8,7,9,5],parti:0,isspeci:1,same:[8,7],proce:8,decod:0,create_tim:3,document:0,conflict:0,complet:[8,0,6,7],closeconnect:8,hostnam:2,keepal:7,director:2,remot:[8,1,3,4,5,7],rais:[8,7,2,9,6],temporari:1,auth:8,protocolerror:6,chang:3,googl:0,nbnsprotocol:[4,0,9],appropri:[4,9],choos:[8,7],entri:3,itself:[8,0],exampl:[8,0,2,7],command:[8,7],thi:[0,1,3,4,5,7,8,9],english:[8,7],file_obj:[8,7],retrievefil:[8,7],ccc:[4,9],latest:0,identifi:[8,7],just:[8,9],mypassword:2,createdirectori:[8,7],tcp:[8,5,7],notconnectederror:[8,6],touch:[4,8,9],yet:6,iana:[4,9],storefil:[8,7],web:0,samba:0,expos:8,adderrback:8,add:[8,9],discret:0,dixon:0,exercis:0,els:[8,7],subsequ:2,match:[4,8,9,7],retrievefilefactori:8,applic:[4,0,8,9,3],around:9,read:[8,0,2,7,5],thoma:0,know:[4,8,9],bit:[8,0,7],password:[8,7],python3:[8,7],like:[8,7,2],success:[5,7],integ:[0,3,4,7,8,9],server:[0,1,3,8,5,7],build_open:2,print_queu:1,either:[8,7],page:[0,5],underli:[4,0,8,6,7],encount:[7,3],right:[8,7],old:[8,7],often:5,captur:[8,7],acknowledg:8,interv:8,linux:0,some:[8,0,7],back:[4,8,9,7],intern:[8,0,5],istemporari:1,successfulli:[8,7],transport:[8,0,9],txt:[8,7,2],smbtest:[8,7],avoid:8,smb2_struct:0,sharedfold:2,subclass:[8,5],buffer:5,retri:8,leav:[4,8,9,7],pysmb:[0,8,5,6,7,9],ddd:[4,9],machin:[0,2,4,7,8,9],object:[8,7,2],shadow:[8,7],workgroup:[8,7],atttempt:7,host:[8,7,2],nmb:[4,0,9],offset:[8,7],post:[8,5],impos:[8,7],proceed:[8,7],about:[8,7,3,1],obj:[8,7],socket:[4,5,7],idl:7,pymsb:8,includ:[0,5],commerci:0,mean:8,pyasn1:0,disabl:[8,7],block:[4,0,9,7],routin:0,client:[8,0,7],own:[8,0,5],bbb:[4,9],within:[8,0,7],encod:0,automat:[4,8,9,7],due:5,empti:[8,2,3,4,7,9],wrap:9,opportun:8,your:[0,3,4,5,7,8,9],local_fil:2,transfer:[8,0],support:[8,0,2,6,7],"long":[8,7,3],smb_messag:6,avail:[8,0,7],start:[8,7,9],anderson:[4,9],ipv4:4,files:7,creation:[3,1],server_ip:[8,7],tupl:[8,7],whiteman:0,translat:0,newer:[8,7],"true":[8,1,3,4,7,9],utc:[8,7],made:[8,0,7],utf:2,cif:[0,3,4,5,6,7,8],possibl:0,whether:[8,7],wish:[4,7],maximum:[8,7],asynchron:[5,9,7],limit:[8,7,3],otherwis:[8,7],listpath:[8,7,3],netbio:[0,2,4,5,7,8,9],credienti:8,featur:[8,7,6],constant:[0,1],creat:[8,2,4,5,7,9],"int":[8,7],cover:0,"abstract":0,unsupportedfeatur:6,twist:[8,0,9],incomplet:5,exist:[8,7,2],file:[0,1,2,3,8,5,7],write_result:8,echo:[8,7],again:9,vista:[8,0,7],encrypt:0,excee:8,sequenti:7,when:[0,4,5,6,7,8,9],detail:[0,3,5],data_buf:6,"default":[8,7],valid:2,librari:0,test:0,you:[0,2,3,4,5,7,8,9],functionl:8,smbprotocol:[8,0,3],file_attribut:[8,7,3],urllib2:[0,2],authenthent:8,briefli:5,receiv:[4,8,9,7],eof:[8,7],algorithm:[8,0,7,5],directori:[8,7,2,3],descript:[0,1],alphanumer:[8,7],pathnam:[8,7],time:[8,0,7,3,1],file_fh:2,smbhandler:[0,2]},objtypes:{"0":"py:attribute","1":"py:class","2":"py:method"},titles:["Welcome to pysmb’s documentation!","SharedDevice Class","SMbHandler Class","SharedFile Class","NetBIOS class","Extending pysmb For Other Frameworks","SMB Exceptions","SMBConnection Class","SMBProtocolFactory Class","NBNSProtocol Class"],objnames:{"0":["py","attribute","Python attribute"],"1":["py","class","Python class"],"2":["py","method","Python method"]},filenames:["index","api/smb_SharedDevice","api/smb_SMBHandler","api/smb_SharedFile","api/nmb_NetBIOS","extending","api/smb_exceptions","api/smb_SMBConnection","api/smb_SMBProtocolFactory","api/nmb_NBNSProtocol"]})⏎ |