Uh oh!
There was an error while loading. Please reload this page.
Remove include "sanity check" to get better error - #4474
Closed
nikic wants to merge 5 commits into
Closed
Conversation
Instead of rejecting directories / non-regular files early with a generic error, we should just accept them and error later when a read is attempted. This is more general and will generate a better error message.
ramsey
commented
May 27, 2022
Member
I like this change. What's needed to merge it? |
bukka
reviewed
Mar 17, 2023
bukka
left a comment
Member
There was a problem hiding this comment.
I think it makes sense. I guess this was probably optimization before opcache where those fstat calls would happen on each request but with opcache it doesn't matter that much. So better errors make more sense.
Comment on lines
+520
to
+521
| /* Still add it to open_files so the file_handle destruction logic works correctly. */ | ||
| zend_llist_add_element(&CG(open_files), file_handle); |
Member
There was a problem hiding this comment.
I see that this was already merged as part of other change ( 2f64844 ) so it should be removed from this PR.
krakjoe
commented
Aug 31, 2025
Member
It looks like we can't have this nice thing because windows. If I'm wrong about windows, anyone is welcome to open a new PR that deals with the difference (I'm unsure how, or if it's possible). |
nikic
commented
Aug 31, 2025
MemberAuthor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of rejecting directories / non-regular files early with
a generic error, we should just accept them and error later when a
read is attempted. This is more general and will generate a better
error message.