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

Add parameter for not restricting access to the named tempfile #61

Closed
wants to merge 4 commits into from

Conversation

tbu-
Copy link

@tbu- tbu- commented Jun 22, 2018

Fixes #30.

@tbu-
Copy link
Author

tbu- commented Jun 22, 2018

This is just a PoC right now, will fix the warnings etc. if this can get merged in one way or another.

What do you think about this approach? I couldn't find a way to reset file permissions to default on unixy systems after having opened the file.

This would fix my problem with #30, as I'd like to persist the temporary files to normal files after being done writing to them.

@Stebalien
Copy link
Owner

Sounds reasonable. However, I'd rather accept an std::fs::Permissions object as that's more general and cross platform. Would that work?

@tbu-
Copy link
Author

tbu- commented Jun 23, 2018

Hm. There doesn't seem to be a way to open a file with a given Permissions struct. The struct is opaque except for the readonly bit which isn't helpful in this case (and the mode on unixy systems). This means we could currently only support setting the mode on new files on unixy systems (not even Redox, and certainly not on Windows). I don't think taking a Permissions struct would improve this API.

@Stebalien
Copy link
Owner

Gah. I keep not posting my replies.

You're absolutely correct, that's unfortunate.

@Stebalien
Copy link
Owner

So, thinking about this, I'm fine with this approach. I'd rather have a more general approach but... the only API this touches is the builder. Given that, I'm fine going ahead with this.

@tbu-
Copy link
Author

tbu- commented Jul 21, 2018

Fixed warnings, added some documentation, added a test.

@tbu- tbu- force-pushed the pr_worldaccessible branch 2 times, most recently from d5f5a30 to 6c169c1 Compare July 21, 2018 11:07
@tbu-
Copy link
Author

tbu- commented Jul 21, 2018

Yay, now even compiles on Windows. It's good to go from my side now. :)

@Stebalien
Copy link
Owner

This is still going to need Windows and, preferably, directory support.

@quark-zju
Copy link

Any progress on this? I want this feature too. @tbu- Do you mind if I work on a new pull request?

@tbu-
Copy link
Author

tbu- commented Jun 1, 2019

@quark-zju Feel free to redo this. :)

@lucab
Copy link

lucab commented Jul 16, 2020

Cross-referencing from #114: on Linux though it would be helpful to be able to pass a proper Permissions argument.

@Stebalien
Copy link
Owner

Fixed in #273.

@Stebalien Stebalien closed this Feb 5, 2024
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.

Restore default permissions on persist (on Unix)
4 participants