Set default permissions of a .py file to 755?
Can I change some settings to make the default permissions of a .py file to 755?
Because if I have a .py writing system, I can't find a way to make it runnable without manually going into the files. I"m basically making a blog for someone, and they have no file managing or programming experience, so it would take me ages to teach them how to manually change the permissions.
Is there a way?
-~Reefive Sky
-
This is more of a linux question I think than a cPanel. You could use
Find all files ending in ".py" inside of the current directory ( . ) then have chmod set the permissions to 755. Find will automatically put the found files in the place of the {} in the exec command. The slash and semi-colon ends the find exec command so those are required. Please be careful when batch updating stuff like this, you might want to test this in a controlled test environment, take backups.0 -
Hello @Reefive Sky, Your access level shows as website owner. Without root access to the server, there's nothing you can really do to change the default permissions for new files or directories. With root access, you could alter the default umask settings configured with the OS, but even still that's not really a recommended method because you're only wanting to adjust the default permissions for .py files. You'll sometimes see scripts that include a check to verify the proper permissions are set on specific files (e.g. .py, .cgi). You may want to develop something like that and include it as part of the website files so users can easily see a list of files that need permission changes. You may also want to vote and add feedback to the following feature request: 0
Please sign in to leave a comment.
Comments
2 comments