title: Why the below code is not writing the string "Write this to the file" to the File "my_file"
body: <p>I wrote the below code to write the string "Write this to the file" to the file "my_file". Up on execution the I get "FileWrite Completed Successfully" on the console -- from the callback of the fs.write. But I see nothing in the File.</p>
  
  <pre><code>var fs = require('fs');
  
  function openFileAndAppend(writeBuffer){
      fs.open('./my_file','a',function opened(err,fd){
          if(err){
              console.log(err);
              fs.close(fd,function(err){
                  if(err){
                      console.log(err);
                      console.log("Problem in closing the file upon the Open;");
                  }
              });
          }
          var bufferOffset = 0;
          var bufferLength = writeBuffer.lenght;
          var filePosition = null;
          fs.write(fd,writeBuffer,bufferOffset,bufferLength,filePosition,function(err){
              if(err){
                  console.log(err);
              }
              console.log("FileWrite Completed Successfully");
              fs.close(fd,function(err){
                  console.log("Closing the file");
                  if(err){
                      console.log(err);
                      console.log("Problem in closing the file after the write");
                  }
              });
          });
      });
  }
  
  openFileAndAppend(new Buffer('Write this to the file'));
  </code></pre>
  
  <p>Please help in finding the error.</p>
  
  <p>Thanks in advance!!</p>