Codebase list pysmb / c96dd44
Update docs Michael Teo 10 years ago
37 changed file(s) with 865 addition(s) and 161 deletion(s). Raw diff Collapse all Expand all
00 # Sphinx build info version 1
11 # 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
33 tags: fbb0d17656682115ca4d033fb2f83ba1
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>Overview: module code &mdash; pysmb 1.0.0 documentation</title>
10 <title>Overview: module code &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 </head>
2929 <body>
3030 <div class="related">
3333 <li class="right" style="margin-right: 10px">
3434 <a href="../genindex.html" title="General Index"
3535 accesskey="I">index</a></li>
36 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
36 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3737 </ul>
3838 </div>
3939 <div class="sphinxsidebar">
7979 <li class="right" style="margin-right: 10px">
8080 <a href="../genindex.html" title="General Index"
8181 >index</a></li>
82 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
82 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
8383 </ul>
8484 </div>
8585 <div class="footer">
86 &copy; Copyright 2011, Michael Teo.
86 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
8787 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
8888 </div>
8989 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>nmb.NetBIOS &mdash; pysmb 1.0.0 documentation</title>
10 <title>nmb.NetBIOS &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
161161 <li class="right" style="margin-right: 10px">
162162 <a href="../../genindex.html" title="General Index"
163163 >index</a></li>
164 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
164 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
165165 <li><a href="../index.html" >Module code</a> &raquo;</li>
166166 </ul>
167167 </div>
168168 <div class="footer">
169 &copy; Copyright 2011, Michael Teo.
169 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
170170 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
171171 </div>
172172 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>nmb.NetBIOSProtocol &mdash; pysmb 1.0.0 documentation</title>
10 <title>nmb.NetBIOSProtocol &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
159159 <li class="right" style="margin-right: 10px">
160160 <a href="../../genindex.html" title="General Index"
161161 >index</a></li>
162 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
162 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
163163 <li><a href="../index.html" >Module code</a> &raquo;</li>
164164 </ul>
165165 </div>
166166 <div class="footer">
167 &copy; Copyright 2011, Michael Teo.
167 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
168168 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
169169 </div>
170170 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>smb.SMBConnection &mdash; pysmb 1.0.0 documentation</title>
10 <title>smb.SMBConnection &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
480480 <li class="right" style="margin-right: 10px">
481481 <a href="../../genindex.html" title="General Index"
482482 >index</a></li>
483 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
483 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
484484 <li><a href="../index.html" >Module code</a> &raquo;</li>
485485 </ul>
486486 </div>
487487 <div class="footer">
488 &copy; Copyright 2011, Michael Teo.
488 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
489489 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
490490 </div>
491491 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>smb.SMBProtocol &mdash; pysmb 1.0.0 documentation</title>
10 <title>smb.SMBProtocol &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
392392 <li class="right" style="margin-right: 10px">
393393 <a href="../../genindex.html" title="General Index"
394394 >index</a></li>
395 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
395 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
396396 <li><a href="../index.html" >Module code</a> &raquo;</li>
397397 </ul>
398398 </div>
399399 <div class="footer">
400 &copy; Copyright 2011, Michael Teo.
400 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
401401 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
402402 </div>
403403 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>smb.base &mdash; pysmb 1.0.0 documentation</title>
10 <title>smb.base &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
977977 <li class="right" style="margin-right: 10px">
978978 <a href="../../genindex.html" title="General Index"
979979 >index</a></li>
980 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
980 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
981981 <li><a href="../index.html" >Module code</a> &raquo;</li>
982982 </ul>
983983 </div>
984984 <div class="footer">
985 &copy; Copyright 2011, Michael Teo.
985 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
986986 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
987987 </div>
988988 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>smb.smb_structs &mdash; pysmb 1.0.0 documentation</title>
10 <title>smb.smb_structs &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="up" title="Module code" href="../index.html" />
2929 </head>
3030 <body>
3434 <li class="right" style="margin-right: 10px">
3535 <a href="../../genindex.html" title="General Index"
3636 accesskey="I">index</a></li>
37 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
37 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3838 <li><a href="../index.html" accesskey="U">Module code</a> &raquo;</li>
3939 </ul>
4040 </div>
13541354 <li class="right" style="margin-right: 10px">
13551355 <a href="../../genindex.html" title="General Index"
13561356 >index</a></li>
1357 <li><a href="../../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
1357 <li><a href="../../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
13581358 <li><a href="../index.html" >Module code</a> &raquo;</li>
13591359 </ul>
13601360 </div>
13611361 <div class="footer">
1362 &copy; Copyright 2011, Michael Teo.
1362 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
13631363 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
13641364 </div>
13651365 </body>
44 The SMBConnection is suitable for developers who wish to use pysmb to perform file operations with a remote SMB/CIFS server sequentially.
55
66 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
742
843 Caveats
944 -------
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()
2323 add a handling method to the returned *Deferred* instance via *Deferred.addCallback*. If the file operation fails, the *Deferred.errback* function will be called
2424 with an :doc:`OperationFailure<smb_exceptions>`; on timeout, it will be called with a :doc:`SMBTimeout<smb_exceptions>`.
2525
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
2682 Caveats
2783 -------
2884
55 Welcome to pysmb's documentation!
66 =================================
77
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>`_.
1113
1214 License
1315 -------
2527
2628 * **pyasn1** : Pure Python implementation of ASN.1 parsing and encoding (not included together with pysmb; needs to be installed separately)
2729 * **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.
2933
3034 In various places, there are references to different specifications. Most of these referenced specifications
3135 can be downloaded from Microsoft web site under Microsoft's "Open Specification Promise". If you need to download
5458 * **smb/securityblob.py** :
5559 Provides routines to encode/decode the NTLMSSP security blob in the SMB messages.
5660 * **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
5862 * **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.
6068 * **smb/SMBConnection.py** :
6169 Contains a SMB protocol implementation. All operations are blocking I/O.
6270 * **smb/SMBProtocol.py** :
6371 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.
6474
6575 Using pysmb
6676 ===========
7484 * To use pysmb in applications where you want the file operations to return after they have completed (synchronous style), please read
7585 :doc:`smb.SMBConnection.SMBConnection<api/smb_SMBConnection>` documentation.
7686 * 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.
7788
7889 As a software developer who is looking to modify pysmb so that you can integrate it to other network frameworks:
7990 * Read :doc:`extending`
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>NBNSProtocol Class &mdash; pysmb 1.0.0 documentation</title>
10 <title>NBNSProtocol Class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="next" title="NetBIOS class" href="nmb_NetBIOS.html" />
2929 <link rel="prev" title="Welcome to pysmb’s documentation!" href="../index.html" />
3030 </head>
4141 <li class="right" >
4242 <a href="../index.html" title="Welcome to pysmb’s documentation!"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
114114 </dd></dl>
115115
116116 <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>) &#8211; 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>) &#8211; 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>) &#8211; 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">
117142 <dt id="nmb.NetBIOSProtocol.NBNSProtocol.queryName">
118143 <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>
119144 <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>
165190 <li class="right" >
166191 <a href="../index.html" title="Welcome to pysmb’s documentation!"
167192 >previous</a> |</li>
168 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
193 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
169194 </ul>
170195 </div>
171196 <div class="footer">
172 &copy; Copyright 2011, Michael Teo.
197 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
173198 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
174199 </div>
175200 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>NetBIOS class &mdash; pysmb 1.0.0 documentation</title>
10 <title>NetBIOS class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="next" title="SMBConnection Class" href="smb_SMBConnection.html" />
2929 <link rel="prev" title="NBNSProtocol Class" href="nmb_NBNSProtocol.html" />
3030 </head>
4141 <li class="right" >
4242 <a href="nmb_NBNSProtocol.html" title="NBNSProtocol Class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
126126 </dd></dl>
127127
128128 <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>
132133 <table class="docutils field-list" frame="void" rules="none">
133134 <col class="field-name" />
134135 <col class="field-body" />
141142 </ul>
142143 </td>
143144 </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>) &#8211; 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>) &#8211; 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>) &#8211; Number of seconds to wait for a reply, after which the method will return None</li>
165 </ul>
166 </td>
167 </tr>
144168 <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>
145169 </td>
146170 </tr>
170194 <li class="right" >
171195 <a href="nmb_NBNSProtocol.html" title="NBNSProtocol Class"
172196 >previous</a> |</li>
173 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
197 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
174198 </ul>
175199 </div>
176200 <div class="footer">
177 &copy; Copyright 2011, Michael Teo.
201 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
178202 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
179203 </div>
180204 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>SMBConnection Class &mdash; pysmb 1.0.0 documentation</title>
10 <title>SMBConnection Class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2929 <link rel="prev" title="NetBIOS class" href="nmb_NetBIOS.html" />
3030 </head>
3131 <body>
3636 <a href="../genindex.html" title="General Index"
3737 accesskey="I">index</a></li>
3838 <li class="right" >
39 <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class"
39 <a href="smb_SMBHandler.html" title="SMbHandler Class"
4040 accesskey="N">next</a> |</li>
4141 <li class="right" >
4242 <a href="nmb_NetBIOS.html" title="NetBIOS class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
4949 <h3><a href="../index.html">Table Of Contents</a></h3>
5050 <ul>
5151 <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>
5254 <li><a class="reference internal" href="#caveats">Caveats</a></li>
5355 </ul>
5456 </li>
5860 <p class="topless"><a href="nmb_NetBIOS.html"
5961 title="previous chapter">NetBIOS class</a></p>
6062 <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>
6365 <h3>This Page</h3>
6466 <ul class="this-page-menu">
6567 <li><a href="../_sources/api/smb_SMBConnection.txt"
9092 <h1>SMBConnection Class<a class="headerlink" href="#smbconnection-class" title="Permalink to this headline">¶</a></h1>
9193 <p>The SMBConnection is suitable for developers who wish to use pysmb to perform file operations with a remote SMB/CIFS server sequentially.</p>
9294 <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">&#39;smbtest&#39;</span><span class="p">,</span> <span class="s">&#39;/rfc1001.txt&#39;</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>
93129 <div class="section" id="caveats">
94130 <h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2>
95131 <ul class="simple">
101137 </ul>
102138 <dl class="class">
103139 <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>
105141 <dd><dl class="method">
106142 <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>
108144 <dd><p>Create a new SMBConnection instance.</p>
109145 <p><em>username</em> and <em>password</em> are the user credentials required to authenticate the underlying SMB connection with the remote server.
110146 File operations can only be proceeded after the connection has been authenticated successfully.</p>
111147 <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>
112150 <table class="docutils field-list" frame="void" rules="none">
113151 <col class="field-name" />
114152 <col class="field-body" />
124162 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.
125163 Hence, we can only &#8220;guess&#8221; or try both algorithms.
126164 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>) &#8211; 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&#8217;s configurations; access errors will occur if the remote server requires signing.</li>
169 <li><strong>is_direct_tcp</strong> (<em>boolean</em>) &#8211; 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>
127171 </ul>
128172 </td>
129173 </tr>
139183
140184 <dl class="method">
141185 <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>
143187 <dd><p>Establish the SMB connection to the remote SMB/CIFS server.</p>
144188 <p>You must call this method before attempting any of the file operations with the remote server.
145189 This method will block until the SMB connection has attempted at least one authentication.</p>
238282
239283 <dl class="method">
240284 <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>
242286 <dd><p>Retrieve a directory listing of files/folders at <em>path</em></p>
243287 <table class="docutils field-list" frame="void" rules="none">
244288 <col class="field-name" />
275319 </dd></dl>
276320
277321 <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>) &#8211; the name of the shared folder for the <em>path</em></li>
332 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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">
278344 <dt id="smb.SMBConnection.SMBConnection.rename">
279345 <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>
280346 <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>
296362 <dt id="smb.SMBConnection.SMBConnection.retrieveFile">
297363 <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>
298364 <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>
299366 <table class="docutils field-list" frame="void" rules="none">
300367 <col class="field-name" />
301368 <col class="field-body" />
302369 <tbody valign="top">
303370 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
304371 <li><strong>service_name</strong> (<em>string/unicode</em>) &#8211; the name of the shared folder for the <em>path</em></li>
305 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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> &#8211; 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>) &#8211; 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> &#8211; 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>) &#8211; the name of the shared folder for the <em>path</em></li>
395 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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> &#8211; 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>) &#8211; 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>) &#8211; 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> ).
311404 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>
312405 </td>
313406 </tr>
326419 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
327420 <li><strong>service_name</strong> (<em>string/unicode</em>) &#8211; the name of the shared folder for the <em>path</em></li>
328421 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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> &#8211; 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> &#8211; 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>
331424 </ul>
332425 </td>
333426 </tr>
336429 </tr>
337430 </tbody>
338431 </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&#8217;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>
339456 </dd></dl>
340457
341458 </dd></dl>
356473 <a href="../genindex.html" title="General Index"
357474 >index</a></li>
358475 <li class="right" >
359 <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class"
476 <a href="smb_SMBHandler.html" title="SMbHandler Class"
360477 >next</a> |</li>
361478 <li class="right" >
362479 <a href="nmb_NetBIOS.html" title="NetBIOS class"
363480 >previous</a> |</li>
364 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
481 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
365482 </ul>
366483 </div>
367484 <div class="footer">
368 &copy; Copyright 2011, Michael Teo.
485 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
369486 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
370487 </div>
371488 </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 &mdash; 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> &raquo;</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 &#8220;<a class="reference external" href="smb://">smb://</a>&#8221; 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">&#39;smb://myuserID:[email protected]/sharedfolder/rfc1001.txt&#39;</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&#39;smb://myuserID:[email protected]/sharedfolder/测试文件夹/垃圾文件.dat&#39;</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">&#39;local_file.dat&#39;</span><span class="p">,</span> <span class="s">&#39;rb&#39;</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">&#39;smb://myuserID:[email protected]/sharedfolder/upload_file.dat&#39;</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> &raquo;</li>
159 </ul>
160 </div>
161 <div class="footer">
162 &copy; 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>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>SMBProtocolFactory Class &mdash; pysmb 1.0.0 documentation</title>
10 <title>SMBProtocolFactory Class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <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" />
3030 </head>
3131 <body>
3232 <div class="related">
3939 <a href="smb_SharedDevice.html" title="SharedDevice Class"
4040 accesskey="N">next</a> |</li>
4141 <li class="right" >
42 <a href="smb_SMBConnection.html" title="SMBConnection Class"
42 <a href="smb_SMBHandler.html" title="SMbHandler Class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
4949 <h3><a href="../index.html">Table Of Contents</a></h3>
5050 <ul>
5151 <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>
5254 <li><a class="reference internal" href="#caveats">Caveats</a></li>
5355 </ul>
5456 </li>
5557 </ul>
5658
5759 <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>
6062 <h4>Next topic</h4>
6163 <p class="topless"><a href="smb_SharedDevice.html"
6264 title="next chapter">SharedDevice Class</a></p>
110112 <p>If you are interested in learning the results of the operation or to know when the operation has completed, you should
111113 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
112114 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">&#39;Auth failed&#39;</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">&#39;smbtest&#39;</span>
152 <span class="n">factory</span><span class="o">.</span><span class="n">path</span> <span class="o">=</span> <span class="s">&#39;/rfc1001.txt&#39;</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>
113167 <div class="section" id="caveats">
114168 <h2>Caveats<a class="headerlink" href="#caveats" title="Permalink to this headline">¶</a></h2>
115169 <ul class="simple">
120174 </ul>
121175 <dl class="class">
122176 <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>
124178 <dd><dl class="method">
125179 <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>
128184 <p><em>username</em> and <em>password</em> are the user credentials required to authenticate the underlying SMB connection with the remote server.
129185 File operations can only be proceeded after the connection has been authenticated successfully.</p>
130186 <table class="docutils field-list" frame="void" rules="none">
142198 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.
143199 Hence, we can only &#8220;guess&#8221; or try both algorithms.
144200 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>) &#8211; 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&#8217;s configurations; access errors will occur if the remote server requires signing.</li>
205 <li><strong>is_direct_tcp</strong> (<em>boolean</em>) &#8211; 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>
145207 </ul>
146208 </td>
147209 </tr>
256318
257319 <dl class="method">
258320 <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>
260322 <dd><p>Retrieve a directory listing of files/folders at <em>path</em></p>
261323 <table class="docutils field-list" frame="void" rules="none">
262324 <col class="field-name" />
290352 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><strong>timeout</strong> (<em>integer/float</em>) &#8211; Number of seconds that pysmb will wait before raising <em>SMBTimeout</em> via the returned <em>Deferred</em> instance&#8217;s <em>errback</em> method.</td>
291353 </tr>
292354 <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>) &#8211; the name of the shared folder for the <em>path</em></li>
371 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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>
293377 </tr>
294378 </tbody>
295379 </table>
346430 <dt id="smb.SMBProtocol.SMBProtocolFactory.retrieveFile">
347431 <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>
348432 <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>
349434 <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
350435 of each SMB/CIFS data message, it will be packetized into a series of request messages (each message will request about about 60kBytes).
351436 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>
356441 <tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
357442 <li><strong>service_name</strong> (<em>string/unicode</em>) &#8211; the name of the shared folder for the <em>path</em></li>
358443 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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> &#8211; 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> &#8211; 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>) &#8211; the name of the shared folder for the <em>path</em></li>
469 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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> &#8211; 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>) &#8211; 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>) &#8211; 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> ).
364478 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>
365479 </td>
366480 </tr>
384498 <li><strong>service_name</strong> (<em>string/unicode</em>) &#8211; the name of the shared folder for the <em>path</em></li>
385499 <li><strong>path</strong> (<em>string/unicode</em>) &#8211; 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.
386500 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> &#8211; 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> &#8211; 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>
388502 </ul>
389503 </td>
390504 </tr>
393507 </tr>
394508 </tbody>
395509 </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&#8217;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>
396528 </dd></dl>
397529
398530 <dl class="attribute">
405537 <dt id="smb.SMBProtocol.SMBProtocolFactory.isReady">
406538 <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>
407539 <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>
408546 </dd></dl>
409547
410548 </dd></dl>
428566 <a href="smb_SharedDevice.html" title="SharedDevice Class"
429567 >next</a> |</li>
430568 <li class="right" >
431 <a href="smb_SMBConnection.html" title="SMBConnection Class"
569 <a href="smb_SMBHandler.html" title="SMbHandler Class"
432570 >previous</a> |</li>
433 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
571 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
434572 </ul>
435573 </div>
436574 <div class="footer">
437 &copy; Copyright 2011, Michael Teo.
575 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
438576 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
439577 </div>
440578 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>SharedDevice Class &mdash; pysmb 1.0.0 documentation</title>
10 <title>SharedDevice Class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="next" title="SharedFile Class" href="smb_SharedFile.html" />
2929 <link rel="prev" title="SMBProtocolFactory Class" href="smb_SMBProtocolFactory.html" />
3030 </head>
4141 <li class="right" >
4242 <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
147147 <li class="right" >
148148 <a href="smb_SMBProtocolFactory.html" title="SMBProtocolFactory Class"
149149 >previous</a> |</li>
150 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
150 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
151151 </ul>
152152 </div>
153153 <div class="footer">
154 &copy; Copyright 2011, Michael Teo.
154 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
155155 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
156156 </div>
157157 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>SharedFile Class &mdash; pysmb 1.0.0 documentation</title>
10 <title>SharedFile Class &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="next" title="SMB Exceptions" href="smb_exceptions.html" />
2929 <link rel="prev" title="SharedDevice Class" href="smb_SharedDevice.html" />
3030 </head>
4141 <li class="right" >
4242 <a href="smb_SharedDevice.html" title="SharedDevice Class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
171171 <li class="right" >
172172 <a href="smb_SharedDevice.html" title="SharedDevice Class"
173173 >previous</a> |</li>
174 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
174 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
175175 </ul>
176176 </div>
177177 <div class="footer">
178 &copy; Copyright 2011, Michael Teo.
178 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
179179 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
180180 </div>
181181 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>SMB Exceptions &mdash; pysmb 1.0.0 documentation</title>
10 <title>SMB Exceptions &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '../',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="../_static/jquery.js"></script>
2525 <script type="text/javascript" src="../_static/underscore.js"></script>
2626 <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" />
2828 <link rel="next" title="Extending pysmb For Other Frameworks" href="../extending.html" />
2929 <link rel="prev" title="SharedFile Class" href="smb_SharedFile.html" />
3030 </head>
4141 <li class="right" >
4242 <a href="smb_SharedFile.html" title="SharedFile Class"
4343 accesskey="P">previous</a> |</li>
44 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
44 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4545 </ul>
4646 </div>
4747 <div class="sphinxsidebar">
135135 <li class="right" >
136136 <a href="smb_SharedFile.html" title="SharedFile Class"
137137 >previous</a> |</li>
138 <li><a href="../index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
138 <li><a href="../index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
139139 </ul>
140140 </div>
141141 <div class="footer">
142 &copy; Copyright 2011, Michael Teo.
142 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
143143 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
144144 </div>
145145 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>Extending pysmb For Other Frameworks &mdash; pysmb 1.0.0 documentation</title>
10 <title>Extending pysmb For Other Frameworks &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="_static/jquery.js"></script>
2525 <script type="text/javascript" src="_static/underscore.js"></script>
2626 <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" />
2828 <link rel="prev" title="SMB Exceptions" href="api/smb_exceptions.html" />
2929 </head>
3030 <body>
3737 <li class="right" >
3838 <a href="api/smb_exceptions.html" title="SMB Exceptions"
3939 accesskey="P">previous</a> |</li>
40 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
40 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4141 </ul>
4242 </div>
4343 <div class="sphinxsidebar">
112112 <li class="right" >
113113 <a href="api/smb_exceptions.html" title="SMB Exceptions"
114114 >previous</a> |</li>
115 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
115 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
116116 </ul>
117117 </div>
118118 <div class="footer">
119 &copy; Copyright 2011, Michael Teo.
119 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
120120 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
121121 </div>
122122 </body>
99 <head>
1010 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1111
12 <title>Index &mdash; pysmb 1.0.0 documentation</title>
12 <title>Index &mdash; pysmb 1.1.5 documentation</title>
1313
1414 <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
1515 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1717 <script type="text/javascript">
1818 var DOCUMENTATION_OPTIONS = {
1919 URL_ROOT: '',
20 VERSION: '1.0.0',
20 VERSION: '1.1.5',
2121 COLLAPSE_INDEX: false,
2222 FILE_SUFFIX: '.html',
2323 HAS_SOURCE: true
2626 <script type="text/javascript" src="_static/jquery.js"></script>
2727 <script type="text/javascript" src="_static/underscore.js"></script>
2828 <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" />
3030 </head>
3131 <body>
3232 <div class="related">
3535 <li class="right" style="margin-right: 10px">
3636 <a href="#" title="General Index"
3737 accesskey="I">index</a></li>
38 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
38 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
3939 </ul>
4040 </div>
4141 <div class="sphinxsidebar">
253253 <dt><a href="api/smb_SharedDevice.html#smb.base.SharedDevice.isTemporary">isTemporary (smb.base.SharedDevice attribute)</a>
254254 </dt>
255255
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>
256266 </dl></td>
257267 </tr></table>
258268
293303 </dt>
294304
295305 </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>
296316 </dl></td>
297317 </tr></table>
298318
362382 <table style="width: 100%" class="indextable genindextable"><tr>
363383 <td style="width: 33%" valign="top"><dl>
364384
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
365397 <dt><a href="api/nmb_NetBIOS.html#nmb.NetBIOS.NetBIOS.queryName">queryName() (nmb.NetBIOS.NetBIOS method)</a>
366398 </dt>
367399
387419 </dt>
388420
389421 </dl></dd>
390 </dl></td>
391 <td style="width: 33%" valign="top"><dl>
392422
393423 <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection.retrieveFile">retrieveFile() (smb.SMBConnection.SMBConnection method)</a>
394424 </dt>
400430
401431 </dl></dd>
402432 </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>
403445 </tr></table>
404446
405447 <h2 id="S">S</h2>
418460 </dt>
419461
420462
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
421495 <dt><a href="api/smb_SMBConnection.html#smb.SMBConnection.SMBConnection">SMBConnection (class in smb.SMBConnection)</a>
422496 </dt>
423497
424 </dl></td>
425 <td style="width: 33%" valign="top"><dl>
426498
427499 <dt><a href="api/smb_SMBProtocolFactory.html#smb.SMBProtocol.SMBProtocolFactory">SMBProtocolFactory (class in smb.SMBProtocol)</a>
428500 </dt>
477549 <li class="right" style="margin-right: 10px">
478550 <a href="#" title="General Index"
479551 >index</a></li>
480 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
552 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
481553 </ul>
482554 </div>
483555 <div class="footer">
484 &copy; Copyright 2011, Michael Teo.
556 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
485557 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
486558 </div>
487559 </body>
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>Welcome to pysmb’s documentation! &mdash; pysmb 1.0.0 documentation</title>
10 <title>Welcome to pysmb’s documentation! &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2424 <script type="text/javascript" src="_static/jquery.js"></script>
2525 <script type="text/javascript" src="_static/underscore.js"></script>
2626 <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="#" />
2828 <link rel="next" title="NBNSProtocol Class" href="api/nmb_NBNSProtocol.html" />
2929 </head>
3030 <body>
3737 <li class="right" >
3838 <a href="api/nmb_NBNSProtocol.html" title="NBNSProtocol Class"
3939 accesskey="N">next</a> |</li>
40 <li><a href="#">pysmb 1.0.0 documentation</a> &raquo;</li>
40 <li><a href="#">pysmb 1.1.5 documentation</a> &raquo;</li>
4141 </ul>
4242 </div>
4343 <div class="sphinxsidebar">
8787
8888 <div class="section" id="welcome-to-pysmb-s-documentation">
8989 <h1>Welcome to pysmb&#8217;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>
9394 <div class="section" id="license">
9495 <h2>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h2>
9596 <p>pysmb itself is licensed under an opensource license.
105106 <ul class="simple">
106107 <li><strong>pyasn1</strong> : Pure Python implementation of ASN.1 parsing and encoding (not included together with pysmb; needs to be installed separately)</li>
107108 <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>
109112 </ul>
110113 <p>In various places, there are references to different specifications. Most of these referenced specifications
111114 can be downloaded from Microsoft web site under Microsoft&#8217;s &#8220;Open Specification Promise&#8221;. If you need to download
133136 <li><strong>smb/securityblob.py</strong> :
134137 Provides routines to encode/decode the NTLMSSP security blob in the SMB messages.</li>
135138 <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>
137140 <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>
139146 <li><strong>smb/SMBConnection.py</strong> :
140147 Contains a SMB protocol implementation. All operations are blocking I/O.</li>
141148 <li><strong>smb/SMBProtocol.py</strong> :
142149 Contains the SMB protocol implementation for use in the Twisted framework.</li>
150 <li><strong>smb/SMBHandler.py</strong> :
151 Provides support for &#8220;<a class="reference external" href="smb://">smb://</a>&#8221; URL in the urllib2 python package.</li>
143152 </ul>
144153 </div>
145154 <div class="section" id="using-pysmb">
157166 <li>To use pysmb in applications where you want the file operations to return after they have completed (synchronous style), please read
158167 <a class="reference internal" href="api/smb_SMBConnection.html"><em>smb.SMBConnection.SMBConnection</em></a> documentation.</li>
159168 <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 &#8220;<a class="reference external" href="smb://">smb://</a>&#8221; URL in urllib2 python package, read <a class="reference internal" href="api/smb_SMBHandler.html"><em>smb.SMBHandler.SMBHandler</em></a> documentation.</li>
160170 </ul>
161171 </dd>
162172 <dt>As a software developer who is looking to modify pysmb so that you can integrate it to other network frameworks:</dt>
173183 <li class="toctree-l1"><a class="reference internal" href="api/nmb_NBNSProtocol.html">NBNSProtocol Class</a></li>
174184 <li class="toctree-l1"><a class="reference internal" href="api/nmb_NetBIOS.html">NetBIOS class</a></li>
175185 <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>
176187 <li class="toctree-l1"><a class="reference internal" href="api/smb_SMBProtocolFactory.html">SMBProtocolFactory Class</a></li>
177188 <li class="toctree-l1"><a class="reference internal" href="api/smb_SharedDevice.html">SharedDevice Class</a></li>
178189 <li class="toctree-l1"><a class="reference internal" href="api/smb_SharedFile.html">SharedFile Class</a></li>
201212 <li class="right" >
202213 <a href="api/nmb_NBNSProtocol.html" title="NBNSProtocol Class"
203214 >next</a> |</li>
204 <li><a href="#">pysmb 1.0.0 documentation</a> &raquo;</li>
215 <li><a href="#">pysmb 1.1.5 documentation</a> &raquo;</li>
205216 </ul>
206217 </div>
207218 <div class="footer">
208 &copy; Copyright 2011, Michael Teo.
219 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
209220 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
210221 </div>
211222 </body>
Binary diff not shown
77 <head>
88 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
99
10 <title>Search &mdash; pysmb 1.0.0 documentation</title>
10 <title>Search &mdash; pysmb 1.1.5 documentation</title>
1111
1212 <link rel="stylesheet" href="_static/sphinxdoc.css" type="text/css" />
1313 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
1515 <script type="text/javascript">
1616 var DOCUMENTATION_OPTIONS = {
1717 URL_ROOT: '',
18 VERSION: '1.0.0',
18 VERSION: '1.1.5',
1919 COLLAPSE_INDEX: false,
2020 FILE_SUFFIX: '.html',
2121 HAS_SOURCE: true
2525 <script type="text/javascript" src="_static/underscore.js"></script>
2626 <script type="text/javascript" src="_static/doctools.js"></script>
2727 <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" />
2929 <script type="text/javascript">
3030 jQuery(function() { Search.loadIndex("searchindex.js"); });
3131 </script>
3939 <li class="right" style="margin-right: 10px">
4040 <a href="genindex.html" title="General Index"
4141 accesskey="I">index</a></li>
42 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
42 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
4343 </ul>
4444 </div>
4545 <div class="sphinxsidebar">
8787 <li class="right" style="margin-right: 10px">
8888 <a href="genindex.html" title="General Index"
8989 >index</a></li>
90 <li><a href="index.html">pysmb 1.0.0 documentation</a> &raquo;</li>
90 <li><a href="index.html">pysmb 1.1.5 documentation</a> &raquo;</li>
9191 </ul>
9292 </div>
9393 <div class="footer">
94 &copy; Copyright 2011, Michael Teo.
94 &copy; Copyright 2001-2013, Michael Teo http://miketeo.net/.
9595 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.2.
9696 </div>
9797 </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&#8217;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&#8217;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"]})