How to handle concurrent file write requests on a node server with socket.io

Viewed 8116

How to handle concurrent file write requests on a node server with socket.io. I am using this to write:

fs.writefile('abc.txt','datatobewritten','utf8',function(err){});

I have a file abc.txt and suppose two users try to write on the same time on this file then I am getting an error, so how do I queue multiple requests.

2 Answers
Related