util/misc.py
changeset 3498 cf4e6a7d40f8
parent 3496 bd4be02fe102
child 3750 f62625418bff
equal deleted inserted replaced
3497:1b8906ca2a50 3498:cf4e6a7d40f8
    43     for root, dirs, files in os.walk(path):
    43     for root, dirs, files in os.walk(path):
    44         files = [f for f in files if not f[0] == '.']
    44         files = [f for f in files if not f[0] == '.']
    45         dirs[:] = [d for d in dirs if not d[0] == '.']
    45         dirs[:] = [d for d in dirs if not d[0] == '.']
    46         if sys.platform.startswith('win'):
    46         if sys.platform.startswith('win'):
    47             try:
    47             try:
    48                 testdirpath = os.path.join(root, "testdir_", random.randint(0, 4294967296))
    48                 testdirpath = os.path.join(root, "testdir_" + str(random.randint(0, 4294967296)))
    49                 os.mkdir(testdirpath)
    49                 os.mkdir(testdirpath)
    50                 os.rmmir(testdirpath)
    50                 os.rmdir(testdirpath)
    51             except:
    51             except:
    52                 return False
    52                 return False
    53         else:
    53         else:
    54             if os.access(root, os.W_OK) is not True:
    54             if os.access(root, os.W_OK) is not True:
    55                 return False
    55                 return False