-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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: add note for platform specific flags fs.open()
#6136
doc: add note for platform specific flags fs.open()
#6136
Conversation
@@ -783,6 +783,22 @@ On Linux, positional writes don't work when the file is opened in append mode. | |||
The kernel ignores the position argument and always appends the data to | |||
the end of the file. | |||
|
|||
_Note: The behavior of `fs.open()` is platform specific for some flags. As such, | |||
opening a directory on OS X with `'a+''`, like in the example below, will return |
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.
There's an extra '
in the flag on this line.
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.
Thx. Fixed
Linux gives |
Amended Linux. Change wording bit around there. Thx. |
returned._ | ||
|
||
```js | ||
// OS X |
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.
Might wanna add OS X and Linux
LGTM with nits. |
Done. |
LGTM By the way - I like the work you've been doing with covering all the caveats @eljefedelrodeodeljefe but I'm worried it might confuse new users by blasting them with a lot of information not all of them care about. I wonder if we should collapse notes by default or only show the first line or something like that. I'm CCing @nodejs/documentation for discussion about that but feel free to move the discussion to the docs repo if it starts derailing things here. |
That's a very good idea. I think Chris is calling for a meeting soon. Let's put this on the agenda then. We had similar things I would call "added dimension" like the es6/es5 switch. Thx |
LGTM |
I'd rather see more information than very terse descriptions. But I think it should be terse (one sentence) with links if the problem is not node.js itself. Maybe we could put those extra information in a collapsible section. |
I like the direction it takes, @stevemao. @benjamingr care for landing? |
It may be a worthwhile exercise to have a doc/topics page that discusses the platform specific variances that exist in the |
This will need a rebase since the commit renaming the files landed. |
closes #3643 E.g. fs.open('<directory>', 'a+', console.log)
rebased |
Awesome, thank you. One last round of review from @nodejs/documentation? |
Still LGTM |
Landed in ae991e7 |
Note describing platform specific differences in fs.open E.g. fs.open('<directory>', 'a+', console.log) Fixes: nodejs#3643 PR-URL: nodejs#6136 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
@eljefedelrodeodeljefe does this apply to v4.x? |
Checklist
Affected core subsystem(s)
doc
Description of change
add note for platform specific flags
fs.open()
closes #3643
E.g. fs.open('', 'a+', console.log)