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

Windows: path.join is lowercasing the drive letter #2466

Closed
adam-lynch opened this issue Oct 15, 2014 · 6 comments
Closed

Windows: path.join is lowercasing the drive letter #2466

adam-lynch opened this issue Oct 15, 2014 · 6 comments
Labels

Comments

@adam-lynch
Copy link

To reproduce:

  • Run nw.exe from 0.10.5

  • Paste this in the dev tools console:

    var path = require('path');
    var os = require('os');
    console.log(path.join(os.tmpdir(), 'Ab'));

Expected: C:\........\Ab

Actual: c:\....\Ab


Happens with 0.10.5 but not 0.8.6. Tested on Windows 7 and 8.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@chaseWillden
Copy link
Contributor

That's actually not an issue with Node-Webkit per se. You can find the Node.js references here

Specifically the code exporting the normalize function in exports.normalize

// If device is a drive letter, we'll normalize to lower case.
    if (device && device.charAt(1) === ':') {
      device = device[0].toLowerCase() + device.substr(1);
    }

and in exports.join (i.e. path.join) normalize is called:

return exports.normalize(joined);

So by default, the drive letter is lower cased by default by Node.Js standards.

@adam-lynch
Copy link
Author

Yeah I assumed it was probably something Node had changed. Do you know which version changed this?

@chaseWillden
Copy link
Contributor

Here's the revision page and I believe that was released in version v0.10.25 of NodeJs on January 23

@adam-lynch
Copy link
Author

Node issue: nodejs/node-v0.x-archive#7031

@Christywl
Copy link
Contributor

Works fine on nwjs-sdk-v0.26.3, please try the latest nwjs build.

@adam-lynch
Copy link
Author

Optimistically closing 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants