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: clarify symlink resolution for __filename #24587

Closed
wants to merge 2 commits into from

Conversation

@Trott
Copy link
Member

commented Nov 24, 2018

Make it more explicit that symlinks are resolved in __filename.

Refs: #22602 (comment)

/ping @sam-github @Pomax

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: #22602 (comment)
@@ -491,8 +491,8 @@ added: v0.0.1

* {string}

The file name of the current module. This is the resolved absolute path of the
current module file.
The file name of the current module. This is current module file's absolute path

This comment has been minimized.

Copy link
@addaleax

addaleax Nov 24, 2018

Member

Just an idea, but I think file could be omitted or moved before path, which might be even clearer?

This comment has been minimized.

Copy link
@Trott

Trott Nov 24, 2018

Author Member

So either current module's absolute path or else current module's absolute file path? It's subtle, but I wonder if that might make someone expect __dirname value instead of __filename if a module is loaded or invoked at the directory level (e.g., node . instead of node index.js).

@Trott

This comment has been minimized.

Copy link
Member Author

commented Nov 24, 2018

One thing this does not mention explicitly is that . and .. are also resolved. To me, that seems obvious/implied by "file's absolute path" but I'm flagging this here in case others disagree. (The wording being replaced here makes that very easy to miss too, and it hasn't seemed to cause any problems.)

doc/api/modules.md Outdated Show resolved Hide resolved
@Trott

This comment has been minimized.

Copy link
Member Author

commented Nov 24, 2018

Trott added a commit to Trott/io.js that referenced this pull request Nov 27, 2018
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: nodejs#22602 (comment)
PR-URL: nodejs#24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@Trott

This comment has been minimized.

Copy link
Member Author

commented Nov 27, 2018

Landed in bb04a8b

@Trott Trott closed this Nov 27, 2018

targos added a commit that referenced this pull request Nov 27, 2018
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: #22602 (comment)
PR-URL: #24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
rvagg added a commit that referenced this pull request Nov 28, 2018
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: #22602 (comment)
PR-URL: #24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@BridgeAR BridgeAR referenced this pull request Dec 5, 2018
4 of 4 tasks complete
refack added a commit to refack/node that referenced this pull request Jan 14, 2019
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: nodejs#22602 (comment)
PR-URL: nodejs#24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
BethGriggs added a commit that referenced this pull request Feb 11, 2019
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: #22602 (comment)
PR-URL: #24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@BethGriggs BethGriggs referenced this pull request Feb 12, 2019
rvagg added a commit that referenced this pull request Feb 28, 2019
doc: clarify symlink resolution for __filename
Make it more explicit that symlinks are resolved in `__filename`.

Refs: #22602 (comment)
PR-URL: #24587
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.