samba@lists.samba.org
[Top] [All Lists]

Re: [Samba] python: listing samba shares

Subject: Re: [Samba] python: listing samba shares
From: Ricardo Jorge
Date: Sun, 16 Aug 2009 15:43:16 +0100
Hi,

Here is some code to get you going. Try it out.

#!/usr/bin/env python

import sys

sys.path.append('/usr/local/samba/lib/python2.6/site-packages')
sys.path.append('/usr/local/samba/lib/python2.6/site-packages/samba')
sys.path.append('/usr/local/samba/lib/python2.6/site-packages/samba/dcerpc')

import param, shares

samba_lp = param.LoadParm()
samba_lp.load_default()

container = shares.SharesContainer(samba_lp)

for share in container:
        print "Path for " + share + ": " + samba_lp.get("path", share)





On Sun, Aug 16, 2009 at 3:37 PM, Igor Katson<descentspb@xxxxxxxxx> wrote:
> I've been googling that for a long time, but couldn't find an answer.
> I also checked the python-samba Debian (ubuntu) package contents and even
> compiled samba 4.0.0 alpha8, and checked its python libraries, but couldn't
> find anything regarding viewing the shares contents there.
>
> Is it possible to list samba shares and their contents of a particular host?
> --
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
>
-- 
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba

<Prev in Thread] Current Thread [Next in Thread>