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

check if data folder is a writable directory #2811

Merged
merged 2 commits into from
Oct 14, 2022

Conversation

stefan0xC
Copy link
Contributor

@stefan0xC stefan0xC commented Oct 11, 2022

Adds a check if the data folder is a directory and also returns a more verbose error message if the permission was denied when creating a file.

I tried adding something like the following to check_data_folder() as well

let metadata = path.metadata().unwrap();
if metadata.permissions().readonly() {
    warn!("Data folder '{}' is read-only.", data_folder);
}

However, this does not really work because readonly() only checks if anyone has write permissions. 😖

be a bit more verbose about why a file could not be created when it is
caused by a permission denied error.
@dani-garcia dani-garcia merged commit 2dd5086 into dani-garcia:main Oct 14, 2022
@stefan0xC stefan0xC deleted the check-data-folder-permissions branch October 14, 2022 17:10
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

Successfully merging this pull request may close these issues.

2 participants