-
Notifications
You must be signed in to change notification settings - Fork 13k
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
std::fs::create_dir* should take permissions #22415
Comments
We can create a |
@nagisa Hm, but the problem is that methods like |
If I remember correctly there was a lot of discussion (on the RFC) regarding Permissions, because they are not quite supported on Windows (or even some FSes on Unixes) therefore they are only exposed as an extension in respective sys modules. |
This is a relevant comment thread |
@nagisa Oh yes, this was definitely a big part of the RFC effort.But the result was that we have permissions, we just don't expose very much of them at the That is, the |
Nominating for 1.0-beta P-backcompat-libs. |
It seems that both I've checked Go and Python (and C via mingw) and neither of those seem to have this problem. This seems to be a serious oversight in the RFC. |
@mahkoh you can't really compare to what other languages do because they all ignore the mode argument on windows (at least from what I've found). For example here's the source for Go and Python. I also encourage you to be a little more specific instead of saying that the structures are "unusable right now". When you say "there is no way to cross-platform create files that are not-world-readable/writable or executable" it's because there isn't one in the manner of permission bits on posix. I would also encourage you to explore the I would certainly believe that we could add a few more unix-specific extension traits, but I would encourage you to be a little more constructive in what you're requesting. |
I am not talking about unix specific code. Functions that use std::os::unix will not compile on Windows, I assume. I'm talking about cross platform code that doesn't need platform specific functions.
Why does this mean that it cannot be compared? |
1.0 beta, needs-decision, P-backcompat-libs |
I'm going to close this issue. The plan is to instead follow a design similar to opening a file, where we can provide conveniences with reasonable per-platform defaults for @alexcrichton will be following up with an eventual RFC before 1.0. |
I have opened an issue in the RFC repo to track this functionality. |
For someone finding this issue and thinking we still don't have this, we already had this stuff since 1.6.0:
|
The new
fs
module does not provide a way to create a directly with given permissions, which is especially painful forcreate_dir_all
. It should.The RFC specified that these functions should resemble those in
old_io
except for a generic bound, so it's not clear why the permission argument was droppped.The text was updated successfully, but these errors were encountered: