Re: os.path.exists() and Samba shares
On Jul 31, 10:56 pm, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Fri, 31 Jul 2009 13:33:45 -0300, BDZ bdezo...@wisc.edu escribió: On Jul 30, 4:41 pm, Loïc Domaigné loic.domai...@googlemail.com wrote: Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.samba.path.exists(username,password,path). Does anyone have a suggestion on how I can accomplish what I need to do in Python? Could the Python Samba module PySamba be interesting for you?http://sourceforge.net/projects/pysamba/ Unfortunately, although it has the calls I'd want, pysamba appears to be *nix only. I need something that will work under Windows. Is there a set of Python Windows functions (official or contributed) that might do what I need? (I'm new to Python) SAMBA is a Linux implementation of the SMB protocol, natively supported on Windows. You may use the pywin32 package (available on sourceforge.net) to call the WNetAddConnection2 Windows function:http://msdn.microsoft.com/en-us/library/aa385413(VS.85).aspx -- Gabriel Genellina The WNetAddConnection2 function under pywin32 seems to work. I am able to make connections to various SMB network resources hosted by Windows, Mac, and Linux boxes. It has the annoying side effect of opening a connection. There is a Win32 function called NetShareCheck. It sounds perfect. It just checks that the share exists (no connection left open) and does not require username or password. Unfortunately it fails for Mac and Linux SMB resources. Just FYI. I understand Samba and Windows SMB are not the same thing. What I was hoping for when I investigated pySamba was to find a python module/ extension that supported a simple SMB interface and would run from any host platform. -- http://mail.python.org/mailman/listinfo/python-list
Re: os.path.exists() and Samba shares
Hi! SAMBA is a Linux implementation of the SMB protocol, natively supported on Windows. Right. But, with Vista or Seven, only recents releases of Samba are supported. And, Samba know only NTLM release 2 (in register: HKLM\SYSTEM\CurrentControlSet\Control\Lsa value LMCompatibilityLevel ; set 1 or 0. ) @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list
Re: os.path.exists() and Samba shares
On Jul 30, 4:41 pm, Loïc Domaigné loic.domai...@googlemail.com wrote: Hi, Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.samba.path.exists(username,password,path). Does anyone have a suggestion on how I can accomplish what I need to do in Python? Could the Python Samba module PySamba be interesting for you?http://sourceforge.net/projects/pysamba/ HTH, Loïc -- My blog:http://www.domaigne.com/blog Unfortunately, although it has the calls I'd want, pysamba appears to be *nix only. I need something that will work under Windows. Is there a set of Python Windows functions (official or contributed) that might do what I need? (I'm new to Python) -- http://mail.python.org/mailman/listinfo/python-list
Re: os.path.exists() and Samba shares
BDZ bdezo...@wisc.edu writes: Unfortunately, although it has the calls I'd want, pysamba appears to be *nix only. That's because Samba is *nix-only. If you want to use something knowing that it's Samba, you are by definition working on *nix. I need something that will work under Windows. In that case, forget the term “samba”. What you want is the ability to connect, *over a network*, to shares served via the SMB protocol suite. Those shares might be implemented via Samba, MS Windows, or aything else that can speak the SMB protocol suite. Your program, running on Windows, should not need to care about Samba, only about the various SMB protocols. A search for “site:pypi.python.org smb client” gets me directly to URL:http://pypi.python.org/pypi/PySmbClient/. That's totally useless to you though, unfortunately, since it depends on Samba installed — which you can't, by definition, on MS Windows. Is there a set of Python Windows functions (official or contributed) that might do what I need? (I'm new to Python) Not that I know of. It would probably involve a Python wrapper around the native MS Windows networking API, something which I'm not sure has been done. -- \ “Whenever you read a good book, it's like the author is right | `\ there, in the room talking to you, which is why I don't like to | _o__) read good books.” —Jack Handey | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list
Re: os.path.exists() and Samba shares
En Fri, 31 Jul 2009 13:33:45 -0300, BDZ bdezo...@wisc.edu escribió: On Jul 30, 4:41 pm, Loïc Domaigné loic.domai...@googlemail.com wrote: Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.samba.path.exists(username,password,path). Does anyone have a suggestion on how I can accomplish what I need to do in Python? Could the Python Samba module PySamba be interesting for you?http://sourceforge.net/projects/pysamba/ Unfortunately, although it has the calls I'd want, pysamba appears to be *nix only. I need something that will work under Windows. Is there a set of Python Windows functions (official or contributed) that might do what I need? (I'm new to Python) SAMBA is a Linux implementation of the SMB protocol, natively supported on Windows. You may use the pywin32 package (available on sourceforge.net) to call the WNetAddConnection2 Windows function: http://msdn.microsoft.com/en-us/library/aa385413(VS.85).aspx -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list
os.path.exists() and Samba shares
Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.samba.path.exists(username,password,path). Does anyone have a suggestion on how I can accomplish what I need to do in Python? -- http://mail.python.org/mailman/listinfo/python-list
Re: os.path.exists() and Samba shares
Hi, Hello. I have written a Python 3.1 script running on Windows that uses os.path.exists() to connect to network shares. If the various network shares require different user account and password combos than the account the script is running under the routine returns false. I need something like os.samba.path.exists(username,password,path). Does anyone have a suggestion on how I can accomplish what I need to do in Python? Could the Python Samba module PySamba be interesting for you? http://sourceforge.net/projects/pysamba/ HTH, Loïc -- My blog: http://www.domaigne.com/blog -- http://mail.python.org/mailman/listinfo/python-list