4 ms·
> Windows accepts / just as well as the preferred \ So someone can (naively) concatenate paths with / and fs.readFile() and require() etc will still work? I'm
by nailer 11y ago
> Windows accepts / just as well as the preferred \
So someone can (naively) concatenate paths with / and fs.readFile() and require() etc will still work?
I'm on npm v3 right now anyway for the dedupe and better shrinkwrap features so no need for extra work.
- za_creature 11y agoB:\_purgatory>mkdir hello B:\_purgatory>echo "test" > hello/world B:\_purgatory>node > var fs = require("fs") undefined > fs.readFileSync("hello/world") <Buffer 22 74 65 73 74 22 20 0d 0a> As for require, iirc "/" is part of the spec and gets normalized to the OS standards afterwards
- chris_wot 11y agoOK, I just have to ask... what are you developing that it deserves the project title of "_pergatory"?!?
- za_creature 11y agoB: is my workspace partition, and `purgatory` is just the name of a folder I use for files and folders that I will eventually either delete or include in an existing project (helps when I'm in over my head with git). Underscore is there to show up first in explorer
- manyxcxi 11y agoTypically the problems we've had with pathing on Windows is when the module we're trying to use doesn't handle Windows paths as inputs, the other way around hardly (if ever) caused us a problem. I am pretty sure it even resolves something like /Program Files/My Program correctly to C:\Program Files\My Program. We just had a lot of modules barf when they got C:\Path\whatever and were trying to parse the path by hand or do other weird stuff like split on '/'.