mkdir permission denied
18,941
Have you tried using os.system with a sudo command on the operation only?
os.system("sudo mkdir /var/machine/hi")
Author by
Popcorn
Updated on September 15, 2022Comments
-
Popcorn over 1 year
I'm trying to make this directory
/var/machine/hi'
by running this in Python:os.mkdir("/var/machine/hi")
However, I'm getting a
OSError: [Errno 13] Permission denied: '/var/machine/hi'
I have tried the following:
chmod 777 /var/machine
andchmod 777 /var
The owners for
/var
isroot
wheel
The owners for
/var/machine
isroot
wheel
How can I fix/debug this?