heapwolf / lev

The complete REPL & CLI for managing LevelDB instances.
MIT License
296 stars 36 forks source link

windows: Error: ENOENT, no such file or directory 'data\undefined\.lev' #36

Closed remoe closed 9 years ago

remoe commented 10 years ago

When one start "lev" at first in a leveldb database directory it throws:

data>lev

fs.js:427
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: ENOENT, no such file or directory 'data\undefined\.lev'
    at Object.fs.openSync (fs.js:427:18)
    at Object.fs.writeFileSync (fs.js:966:15)
    at Object.exports.readConfig (data\node_modules\lev\lib\utils.js:19:8)

It runs after creating this file 'undefinded/.lev'. But this is annoying.

heapwolf commented 10 years ago

Does "lev ." work?

On Friday, May 9, 2014, Remo E notifications@github.com wrote:

When one start "lev" at first in a leveldb database directory it throws:

data>lev

fs.js:427 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ Error: ENOENT, no such file or directory 'data\undefined.lev' at Object.fs.openSync (fs.js:427:18) at Object.fs.writeFileSync (fs.js:966:15) at Object.exports.readConfig (data\node_modules\lev\lib\utils.js:19:8)

— Reply to this email directly or view it on GitHubhttps://github.com/hij1nx/lev/issues/36 .

Paolo Fragomeni Founder, Here is How http://hereishow.to

github.com/hij1nx twitter.com/hij1nx

remoe commented 10 years ago

no

heapwolf commented 10 years ago

You are on windows? And the result is the same stack trace as before?

On Friday, May 9, 2014, Remo E notifications@github.com wrote:

no

— Reply to this email directly or view it on GitHubhttps://github.com/hij1nx/lev/issues/36#issuecomment-42653959 .

Paolo Fragomeni Founder, Here is How http://hereishow.to

github.com/hij1nx twitter.com/hij1nx

remoe commented 10 years ago

Yes, exact the same. Node version 0.10.28 and Windows 8.1

heapwolf commented 10 years ago

The solution is simple, this Line should be more like this var configFile = path.join(process.env['HOME'], '.lev') -- Can you make that change in /lib/utils.js#L7 and then see how it works? Sorry I don't have windows :[ If it works cane you send a PR?

heapwolf commented 10 years ago

Could it also be that windows does not support/have the concept of the HOME environment variable?

On Friday, May 9, 2014, Remo E notifications@github.com wrote:

Yes, exact the same. Node version 0.10.28

— Reply to this email directly or view it on GitHubhttps://github.com/hij1nx/lev/issues/36#issuecomment-42654566 .

Paolo Fragomeni Founder, Here is How http://hereishow.to

github.com/hij1nx twitter.com/hij1nx

heapwolf commented 9 years ago

may be resolved in version 3.