Node.js addon: File I / O via Node.js FileSystem module from C ++ side

I am working on a linear algebra Node.js addon (written in C ++) and I want to be able to save and read from disk all the objects that I have exposed.

For example, it v = la.load(fs.open("vector.out", "r-"));

will load the vector object that I previously saved with v.save(fs.open("vector.out", "r+"));

. (I do this - I want the user to pass in a Node.js object for file I / O and use that object to load / save my object.)

My question (s):

  • How do I access Node.js objects FileSystem

    from the C ++ side? (On the Javascript side, the user is passing an object to fs

    my function load

    , and I want to extract a file descriptor from that object.)
  • How do Node.js addons usually solve this? Any advice?
+3
c ++ javascript node.js v8


source to share


No one has answered this question yet

Check out similar questions:

1675
Why is reading lines from stdin much slower in C ++ than Python?
1500
Writing Files in Node.js
1177
How to completely uninstall Node.js and reinstall from the beginning (Mac OS X)
1045
Check synchronously if file / directory exists in Node.js
868
In Node.js, how do I include features from other files?
802
How do I get a list of the names of all files present in a directory in Node.js?
543
How do I resolve the "Cannot find a module" error using Node.js?
523
How to save settings \ w630> .js for deployment / config files?
515
node.js delete file
1
How to check in node.js C ++ addon if a promise is resolved



All Articles
Loading...
X
Show
Funny
Dev
Pics