Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all scripts - check if log files are read-only #278

Open
kieranjol opened this issue Jul 5, 2018 · 4 comments
Open

all scripts - check if log files are read-only #278

kieranjol opened this issue Jul 5, 2018 · 4 comments
Assignees

Comments

@kieranjol
Copy link
Owner

Some logs can be read only and the scripts will crash if python can't write to them.

@kieranjol kieranjol self-assigned this Jul 5, 2018
@kieranjol
Copy link
Owner Author

Perhaps ififuncs could get a function that performs various checks such as this that might be required for all scripts.

@mcampos-quinn
Copy link
Contributor

I have a function that takes a path and does a recursive chmod through it... that could be adapted to check the required permission before doing a permission change. You could also make it chown to whatever user the python script is running under.

@kieranjol
Copy link
Owner Author

This sounds exactly like what I need. Is it using a subprocess to call chown,or is it using some permissions function within os? The reason I ask is that chown won't work on windows.

@mcampos-quinn
Copy link
Contributor

It's an os function, but I don't know how fully it's supported on Windows given your needs?

Note: Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value). All other bits are ignored.

Here's my bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants