Closed JasonBoy closed 10 years ago
Post your code because this is working correctly:
properties.parse ("../a/a.properties", { path:true }, function (error, data){ ... });
How are you executing the node program?
I have a app.js in the root dir, 'node app.js' , looks this path should still be releative to the path of app.js, not the path of b.js
If you need to use an absolute path then you have something wrong in the directory tree or in the relative path. The path is forwarded to the fs.readFile()
function, I'm not doing anything weird with it.
https://github.com/gagle/node-properties/blob/master/lib/read.js#L472
Also node app.js
uses a different current working directory than node dir/app.js
, so be aware of this subtle things.
Closing this... it seems that it was an issue not directly related with the lib.
I have a file structure like a (folder) -- a.properties b (folder) -- b.js I read the properties file in b.js , I use the path with '../a/a.properties', but actually it doesnot work, I need to use absolute path, is there any way to fix that, or I write it in wrong way