c9 / vfs-local

A VFS implementation for the local file-system.
MIT License
32 stars 39 forks source link

Slash handling fix for Windows #4

Closed davidebbo closed 12 years ago

davidebbo commented 12 years ago

I ended up just skipping the 'root path must start in /' check on Windows. I was hoping to find some kind of path.isabsolute helper but didn't. Figured it's better to live without this check on Windows than not having work at all!

davidebbo commented 12 years ago

Hmmm, I'm guessing something failed because path.sep didn't exist in Node 0.6.

Suggestion? Maybe just rev the engine requirement in package.json?

Or an alternative is to pass the separator as an fsOption (and default to "/" if not there).

creationix commented 12 years ago

I think we still need to support node 0.6.x for now. I'd rather "just work" on windows without having to pass in the separator.

davidebbo commented 12 years ago

In the absence of path.sep, one possibility is to infer the correct separator by calling path.normalize("/"), which returns "/" on Mac and "\" on Windows.