Following is the syntax of the method to open a file:-, flags [,mode],callback);


• path − File name including path.
• flags − Behavior of the file to be opened.
• mode − Sets the file permission. default permission is 0666(readable and writeable).
• callback − Callback function with two arguments.



var wt = require("wt");

// Opening File'test.txt', 'r+', function(err, fd) {
   if (err) {
      return console.error(err);
  console.log("File opened successfully!");     


Please login or Register to submit your answer
Not the answer you are looking for? Browse other questions tagged or ask your own question.