-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
RFC? Refactor stat #27917
RFC? Refactor stat #27917
Conversation
Summary:
|
base/stat.jl
Outdated
:read | ||
else | ||
error("Unknown permissions type") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't handle multiple permission bits being set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, ok, I must have misunderstood the code. How would I fix it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought I would be ok with permissions
returning a named tuple for all 3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That part is ok, but each of user/group/other might have any combination of read/write/execute.
This is a pretty nice redesign. “Neither” is more commonly called “other”. |
@@ -83,9 +83,13 @@ end | |||
stat(fd::Integer) = stat(RawFD(fd)) | |||
|
|||
""" | |||
stat(file) | |||
stat(file; link = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no spaces around = for keyword arguments
base/stat.jl
Outdated
if link | ||
stat(full_path) | ||
else | ||
lstat(full_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One too many spaces
I really really dislike the change from |
Most of this doesn't really seem like an improvement to me, tbh. |
This PR is taking on too many things at once imo. The getfield on the |
I'd be ok with keeping a few convenience functions ( |
Honestly, I think it's too late for this. We're well past feature freeze so any API that's not deeply broken is not up for change at this point. Maybe in Julia 2.0 or we could have an additional better API here and keep the old one, but that would likely go into a later 1.x release, not 1.0. |
When doing #25188, I noticed there was a lot of unused filesystem functions, and mostly stat ones. Though there didn't seem to be much interest in #25939, and its probably too late in the release cycle, I thought I'd put up a proposal anyway. This is totally incomplete, with only direct changes to the code. I thought I'd see what people think before going through the effort of cleaning up.