win32netcon.STYPE_DISKTREE

Here are the examples of the python api win32netcon.STYPE_DISKTREE taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: pycopia
Source File: WindowsServer.py
View license
    def add_share(self, pathname):
        """Create a new share on this server. A directory is also created.  """
        drive, sharename = os.path.split(pathname)
        if not os.path.isdir(pathname):
            os.mkdir(pathname)
        shinfo={} # shinfo struct
        shinfo['netname'] = sharename
        shinfo['type'] = win32netcon.STYPE_DISKTREE
        shinfo['remark'] = 'Testing share %s' % (sharename,)
        shinfo['permissions'] = 0
        shinfo['max_uses'] = -1
        shinfo['current_uses'] = 0
        shinfo['path'] = pathname
        shinfo['passwd'] = ''
        win32net.NetShareAdd(None,2,shinfo)
        return sharename

Example 2

Project: pycopia
Source File: WindowsServer.py
View license
    def add_share(self, pathname):
        """Create a new share on this server. A directory is also created.  """
        drive, sharename = os.path.split(pathname)
        if not os.path.isdir(pathname):
            os.mkdir(pathname)
        shinfo={} # shinfo struct
        shinfo['netname'] = sharename
        shinfo['type'] = win32netcon.STYPE_DISKTREE
        shinfo['remark'] = 'Testing share %s' % (sharename,)
        shinfo['permissions'] = 0
        shinfo['max_uses'] = -1
        shinfo['current_uses'] = 0
        shinfo['path'] = pathname
        shinfo['passwd'] = ''
        win32net.NetShareAdd(None,2,shinfo)
        return sharename