[Moin-devel] CVS: MoinMoin/util filesys.py,NONE,1.1

J?rgen Hermann jhermann at users.sourceforge.net
Wed May 22 14:38:05 EDT 2002


Update of /cvsroot/moin/MoinMoin/util
In directory usw-pr-cvs1:/tmp/cvs-serv25786/MoinMoin/util

Added Files:
	filesys.py 
Log Message:
Bugfix for permissions on newly created upload dirs


--- NEW FILE: filesys.py ---
"""
    MoinMoin - File System Utilities

    Copyright (c) 2002 by Jürgen Hermann <jh at web.de>
    All rights reserved, see COPYING for details.

    $Id: filesys.py,v 1.1 2002/05/22 21:37:44 jhermann Exp $
"""

import os
from MoinMoin import config


def makeDirs(name, mode=0777):
    """ Like os.makedirs(), but with explicit chmod() calls.
        Fixes some practical permission problems on Linux.
    """
    head, tail = os.path.split(name)
    if not tail:
        head, tail = os.path.split(head)
    if head and tail and not os.path.exists(head):
        makeDirs(head, mode)

    os.mkdir(name, mode & config.umask)
    os.chmod(name, mode & config.umask)






More information about the Moin-devel mailing list