-
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
Trailing slash consistency between __dirname and os.tmpdir() #715
Comments
it may be that this is a platform specific issue, for me they are both without trailing slash, what operating system are you using? |
|
Mac OS. |
Maybe we should make |
It would be nice to be consistent, but it could potentially break existing code. |
Yes it will probably break some existing code, but I still see this as a bug. |
I would be OK with this for a major version bump, but I'd like to hear what others think. |
Right now I am getting through by adding a mandatory '/' everywhere I suspect the slash may or may not be found, and using Probably iojs should work on normalizing the trailing slash to provide for a consistent interface. It is a pain when something works on Mac and fails on Linux, and vice versa. |
I was looking on Github for modules which use |
This is a quick fix in io.js and a quick fix in those modules if they break. I'll go ahead and create a pull request and then the only thing left is to choose whether to merge or not. |
This commit makes `os.tmpdir()` behave consistently on all platforms. It changes `os.tmpdir()` to always return a path without trailing slash. Semver: major Fixes: nodejs#715 PR-URL: nodejs#747 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Landed in next branch as bb97b70 |
Is there a good reason why
os.tmpdir()
ends with a trailing slash, while__dirname
does not? If there is none, it might make sense to make the return values consistent.The text was updated successfully, but these errors were encountered: