-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: imp phrase in fs.md #40255
doc: imp phrase in fs.md #40255
Conversation
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 don't think the change is correct, AFAICT it would result in an error. I think there are three possibilities for file:
URL on Windows:
- have a non empty host name: the
file:
URL represents a UNC pathLines 6760 to 6762 in d9ebc04
// - WHATWG file URLs with hostname convert to UNC path // file://hostname/p/a/t/h/file => \\hostname\p\a\t\h\file readFileSync(new URL('file://hostname/p/a/t/h/file')); - have an empty host name and specify a drive letter: the
file:
represents a local pathLines 6764 to 6766 in d9ebc04
// - WHATWG file URLs with drive letters convert to absolute path // file:///C:/tmp/hello => C:\tmp\hello readFileSync(new URL('file:///C:/tmp/hello')); - have neither: throws
ERR_INVALID_FILE_URL_PATH
Lines 6768 to 6771 in d9ebc04
// - WHATWG file URLs without hostname must have a drive letters readFileSync(new URL('file:///notdriveletter/p/a/t/h/file')); readFileSync(new URL('file:///c/p/a/t/h/file')); // TypeError [ERR_INVALID_FILE_URL_PATH]: File URL path must be absolute
I agree that the phrasing could be improved though.
@aduh95 yes it should be improved , also i think if we can add bullets for all three statements it will be very clear |
Do you want to update this PR to add those bullet points to the docs? |
I don't think bullet points are necessary. There is example code below and the first sentence is quite clear. I agree that the second sentence could be more clear though. |
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.
Thank you @warlock1996!
49b0d96
to
8b35a40
Compare
@aduh95 please merge and close ! |
PR-URL: nodejs#40255 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
Landed in 0d50dfd |
PR-URL: #40255 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: James M Snell <[email protected]>
i think it is confusing, it is more clear now