Skip to content

Abstract unix file permissions in file api's #2623

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

Closed
catamorphism opened this issue Jun 15, 2012 · 6 comments
Closed

Abstract unix file permissions in file api's #2623

catamorphism opened this issue Jun 15, 2012 · 6 comments
Labels
O-windows Operating system: Windows
Milestone

Comments

@catamorphism
Copy link
Contributor

FIXME says "turn mode into something useful?"

@bstrie
Copy link
Contributor

bstrie commented Jun 13, 2013

We appear to only ignore the mode argument on Windows, so this will need someone who knows how Windows prefers to handle modes.

@graydon
Copy link
Contributor

graydon commented Jul 31, 2013

I think we ought to abstract concepts like file-modes at the os:: level into more portable sets of flags. As doing so will change API, I think this is properly classified.

@pnkfelix
Copy link
Member

cc me

@brson
Copy link
Contributor

brson commented Jan 3, 2014

The API's have been cleaned up a lot but this comment still exists in native::file. We can probably look at what libuv does with these flags for some hints as to what to do on windows.

We are still directly exposing the unix permission flags in the API and we might want to reconsider whether this is right. In particular we are still just or-ing together bits instead of using something type safe, not to mention that the unix model doesn't make so much sense on windows.

@brson
Copy link
Contributor

brson commented Feb 19, 2014

Updated title to better reflect the problem: our file API's expose unix-style file permissions that are simply ignored on windows.

@thestinger
Copy link
Contributor

File systems without support for permission bits are often used on Linux and other *nix operating systems. The issue is handled by pretending setting permissions worked, even though it's not doing anything. Since we're already forced into this behaviour on *nix for a file system like FAT32, we do already have a consistent API on Windows. Unless someone can explain what we're doing wrong, I don't see a bug here.

flip1995 pushed a commit to flip1995/rust that referenced this issue Sep 24, 2020
Add `rc_buffer` lint for checking Rc<String> and friends

Fixes rust-lang#2623

This is a bit different from the original PR attempting to implement this type of lint.   Rather than linting against converting into the unwanted types, this PR lints against declaring the unwanted type in a struct or function definition.

I'm reasonably happy with what I have here, although I used the fully qualified type names for the Path and OsString suggestions, and I'm not sure if I should have just used the short versions instead, even if they might not have been declared via use.

Also, I don't know if "buffer type" is the best way to put it or not.  Alternatively I could call it a "growable type" or "growable buffer type", but I was thinking of PathBuf when I started making the lint.

changelog: Add `rc_buffer` lint
RalfJung pushed a commit to RalfJung/rust that referenced this issue Oct 29, 2022
change cronjob time

This way it is again in my morning.
Aaron1011 pushed a commit to Aaron1011/rust that referenced this issue Jan 6, 2023
change cronjob time

This way it is again in my morning.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

6 participants