File: mkdir-m700.py

package info (click to toggle)
dbus 1.16.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 9,056 kB
  • sloc: ansic: 106,015; xml: 9,270; sh: 1,967; python: 242; makefile: 230; cpp: 27
file content (15 lines) | stat: -rwxr-xr-x 358 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/env python3
# Copyright 2022 Collabora Ltd.
# SPDX-License-Identifier: MIT

import os
import sys

# Note that we can't create the XDG_RUNTIME_DIR with permissions 0700
# on MSYS2, which rejects attempts to change permissions, hence "|| true".
os.makedirs(sys.argv[1], exist_ok=True)

try:
    os.chmod(sys.argv[1], 0o700)
except OSError:
    pass