I created a Python script that requires sudo
permissions to run (doing ICMP requests). This script creates a small directory and a couple .csv
files, as well as a log.txt
file. At first, after running the program, I was able to delete the artifacts after running to test directory and file creation.
Now, all of a sudden, OS X Finder is asking me for permissions to delete the directory and log file. I performed a chmod 775 *
on the directory I have my module in and deleted the folder and file as necessary. However, after running the script again, it requires me to fulfill permissions yet again. Another chmod
, I can delete the files and folders. However, every time I run the program I run into the same issue.
Any suggestions on how I can fix this permanently?
sudo mkdir foobar
test gives me the same results, in the Finder. I can actually delete it from the Terminal without being prompted, but the Finder prompts me. The Terminal could be because I just did thesudo
(but that's not my understanding of sudo privileges) or it could be because I'm in the same group (staff) as root.sudo
, though, you could use a command likechown
to make you the own of the folder/files again, then you could delete in the Finder without getting a prompt. So, I think adding achown
or achmod
in the Python script should do the trick!