Skip to content

Print file permissions in octal form. #16976

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

Merged
merged 2 commits into from
Sep 4, 2014
Merged

Print file permissions in octal form. #16976

merged 2 commits into from
Sep 4, 2014

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Sep 3, 2014

Closes #16943.

@lilyball
Copy link
Contributor

lilyball commented Sep 4, 2014

Nice, but I feel like it should be showing a 4-digit number instead of a 3-digit number, e.g. 0700. Note that this isn't because a leading 0 indicates octal in some languages, but rather because file permissions can actually have values 1000 (sticky), 2000 (setgid), and 4000 (setuid). More generally, while I can't come up with any good examples off the top of my head, I feel like I just generally see numeric file permissions written with 4 digits.

Edit: Found an example. umask prints 0022 for me.

@treeman
Copy link
Contributor Author

treeman commented Sep 4, 2014

You're right @kballard, that does make sense.

@alexcrichton updated the permissions to write out 4-digit numbers. Not sure if this messes things up, adding a commit after your r?

@lilyball
Copy link
Contributor

lilyball commented Sep 4, 2014

@treeman Thanks. It doesn't mess things up as long as bors hasn't already started merging your PR (which it hasn't). It just requires a re-review, which I provided.

@treeman
Copy link
Contributor Author

treeman commented Sep 4, 2014

I see, thanks.

@huonw
Copy link
Member

huonw commented Sep 4, 2014

(It doesn't mess things up even if bors has started; iirc it detects it, cancels the merge and moves on to the next r+.)

bors added a commit that referenced this pull request Sep 4, 2014
@bors bors closed this Sep 4, 2014
@bors bors merged commit 38bf999 into rust-lang:master Sep 4, 2014
@treeman treeman deleted the issue-16943 branch September 4, 2014 13:02
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.

Considering using Octal Notation in Permissions Errors
4 participants