Skip to content
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

Closed
wants to merge 1 commit into from
Closed

doc: add note for platform specific flags fs.open() #6136

wants to merge 1 commit into from

Conversation

eljefedelrodeodeljefe
Copy link
Contributor

Checklist
  • tests and code linting passes
  • a test and/or benchmark is included
  • documentation is changed or added
  • the commit message follows commit guidelines
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)

@mscdex mscdex added doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system. labels Apr 9, 2016
@@ -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
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx. Fixed

@silverwind
Copy link
Contributor

Linux gives EISDIR too, might consider adding this information. Otherwise LGTM.

@eljefedelrodeodeljefe
Copy link
Contributor Author

Amended Linux. Change wording bit around there. Thx.

returned._

```js
// OS X
Copy link
Contributor

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

@silverwind
Copy link
Contributor

LGTM with nits.

@eljefedelrodeodeljefe
Copy link
Contributor Author

Done.

@benjamingr
Copy link
Member

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.

@eljefedelrodeodeljefe
Copy link
Contributor Author

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

@jasnell
Copy link
Member

jasnell commented Apr 10, 2016

LGTM

@stevemao
Copy link
Contributor

I'm worried it might confuse new users by blasting them with a lot of information not all of them care about.

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.

@eljefedelrodeodeljefe
Copy link
Contributor Author

I like the direction it takes, @stevemao. @benjamingr care for landing?

@jasnell
Copy link
Member

jasnell commented Apr 19, 2016

It may be a worthwhile exercise to have a doc/topics page that discusses the platform specific variances that exist in the fs module as there are (unfortunately) quite a few. Things such as the differences in fs.watch support, filename encoding differences, flags, etc. Separating that discussion out to a separate doc would help keep us from having to load the API doc down too much and would give us a place to link off too for more discussion. /cc @nodejs/documentation.

@jasnell
Copy link
Member

jasnell commented Apr 21, 2016

This will need a rebase since the commit renaming the files landed.

closes #3643

E.g. fs.open('<directory>', 'a+', console.log)
@eljefedelrodeodeljefe
Copy link
Contributor Author

rebased

@jasnell
Copy link
Member

jasnell commented Apr 21, 2016

Awesome, thank you. One last round of review from @nodejs/documentation?

@silverwind
Copy link
Contributor

Still LGTM

jasnell pushed a commit that referenced this pull request Apr 22, 2016
Note describing platform specific differences in fs.open

E.g. fs.open('<directory>', 'a+', console.log)

Fixes: #3643
PR-URL: #6136
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@jasnell
Copy link
Member

jasnell commented Apr 22, 2016

Landed in ae991e7

@jasnell jasnell closed this Apr 22, 2016
joelostrowski pushed a commit to joelostrowski/node that referenced this pull request Apr 25, 2016
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>
jasnell pushed a commit that referenced this pull request Apr 26, 2016
Note describing platform specific differences in fs.open

E.g. fs.open('<directory>', 'a+', console.log)

Fixes: #3643
PR-URL: #6136
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@MylesBorins
Copy link
Contributor

@eljefedelrodeodeljefe does this apply to v4.x?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fs.open differences on windows vs *nix
7 participants