Closed
Bug 919772
Opened 11 years ago
Closed 7 years ago
sdk/io/fs functions do not work with relative paths
Categories
(Add-on SDK Graveyard :: General, defect, P2)
Tracking
(Not tracked)
RESOLVED
INCOMPLETE
People
(Reporter: jsantell, Unassigned)
References
Details
In node's fs module, relative paths work with their functions:
`fs.writeFileSync('here.txt', 'content')`
Which would write to $PWD/here.txt. The same does not work in our SDK, as it needs an absolute path, since it is ultimately passed into an nsILocalFile, nsIFileOutputStream, or other similar functions.
Comment 1•11 years ago
|
||
What would you evaluate it relative to?
Reporter | ||
Comment 2•11 years ago
|
||
node does it relative to `__dirname` -- not sure if we can do something similar, especially with a xpi'd addon.
Comment 3•11 years ago
|
||
I don't know what __dirname is. Unless fs can read inside xpi files then making it relative to main.js wouldn't make sense. Neither would making it relative to the XPI really. Relative to the profile is about the only thing I can think of.
Priority: -- → P2
Comment 4•7 years ago
|
||
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INCOMPLETE
You need to log in
before you can comment on or make changes to this bug.
Description
•