Tuesday 24 November 2015

having a problem with fs.readfile in nwjs.

I'm embarrassed to shit to even be asking about this, it's about as dog-ass simple kindergarten coder as you can get.I want to open a file into a container. Array, object, I don't care. But right now it's in a 2d array.http://ift.tt/1MPsVwI It probably won't run there, as it's the part of a nwjs bit I'm working on.in the app, I've successfully read the file and parsed it. Then I split it to lines. Then split the lines to fields (tab delimited + empties).however, every example I can find gives the syntax of fs.readfile then proceeds to do nothing but console.log the data and forget it. They do nothing practical with the data.My problem is how do I actually use that data? I've read the file, and put it in containers, and it logs fine when inside the scope of the fs.readfile action. But the data doesn't survive the destruction of the fs.readfile scope.In that fiddle, lines 27-31 are undefined. when I put them inside of the fs.readfile(), they show the expected data but the return doesn't work.How do I get the data out?

Submitted November 24, 2015 at 07:16PM by monsto

No comments:

Post a Comment