I am trying to update a certain file with the writeFileSync  method but it 
is not working

"negotiate": function(menu){
if (menu) {
//this would be changed later to the appropraite request
//get url from menu
//getting task list quesions
menu = fs.readFileSync(rootPath + menu.output, 'utf8');
menu = JSON.parse(menu);
}
var userData = fs.readFileSync(this.pathToUserTable(), 'utf8');
userData = JSON.parse(userData);

userData = this.updateUserDataForNegotiate(userData, menu);
//fs.unlinkSync(this.pathToUserTable());//this not working 
fs.writeFileSync(this.pathToUserTable(), JSON.stringify(userData));//this 
not working 
fs.writeFileSync(rootPath + "/database/users/test.json", JSON.stringify(
userData));//this is working
this.res.send(menu);
},

This is very weird and frustrating, I have been trying for hours to get it 
to work. Pls I need help.



-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/a0825def-229d-4760-94c2-6a56875a51d5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to