function write(entry, content, expectSuccess, callback) {
  var error = 'Writing to: \'' + entry.fullPath + '\'.';

  entry.createWriter(function(writer) {
    writer.onerror = assertEqAndRunCallback.bind(null, expectSuccess, false,
                                                 error, callback);
    writer.onwrite = assertEqAndRunCallback.bind(null, expectSuccess, true,
                                                 error, callback);

    writer.seek(kInitialTestFileContent.length);
    var blob = new Blob([kTextToWrite], {type: 'text/plain'});
    writer.write(blob);
  },
  assertEqAndRunCallback.bind(null, expectSuccess, false,
      'Getting writer for: \'' + entry.fullPath + '\'.', callback));
}
/**
 * Attempts to write |content| to the end of the |entry| and verifies that the
 * operation success is as expected. On success |callback| is called, else the
 * current test is failed.
 *
 * @param {FileEntry} entry File entry to be read.
 * @param {string} content String content to be appended to the file.
 * @param {boolean} expectSuccess Whether the write should succeed.
 * @param {function()} callback Function called if write ends as defined by
 *     |expectSuccess|.
 */
Attempts to write |content| to the end of the |entry| and verifies that the
operation success is as expected. On success |callback| is called, else the
current test is failed.

@param {FileEntry} entry File entry to be read.
@param {string} content String content to be appended to the file.
@param {boolean} expectSuccess Whether the write should succeed.
@param {function()} callback Function called if write ends as defined by
|expectSuccess|.
Attempts to write |content| to the end of the |entry| and verifies that the operation success is as expected . On success |callback| is called else the current test is failed . @param { FileEntry } entry File entry to be read . @param { string } content String content to be appended to the file . @param { boolean } expectSuccess Whether the write should succeed . @param { function () } callback Function called if write ends as defined by |expectSuccess| .
function write(entry, content, expectSuccess, callback) {
  var error = 'Writing to: \'' + entry.fullPath + '\'.';
  entry.createWriter(function(writer) {
    writer.onerror = assertEqAndRunCallback.bind(null, expectSuccess, false,
                                                 error, callback);
    writer.onwrite = assertEqAndRunCallback.bind(null, expectSuccess, true,
                                                 error, callback);
    writer.seek(kInitialTestFileContent.length);
    var blob = new Blob([kTextToWrite], {type: 'text/plain'});
    writer.write(blob);
  },
  assertEqAndRunCallback.bind(null, expectSuccess, false,
      'Getting writer for: \'' + entry.fullPath + '\'.', callback));
}
function write ( entry , content , expectSuccess , callback ) { var error = 'Writing to: \'' + entry . fullPath + '\'.' ; entry . createWriter ( function ( writer ) { writer . onerror = assertEqAndRunCallback . bind ( null , expectSuccess , false , error , callback ) ; writer . onwrite = assertEqAndRunCallback . bind ( null , expectSuccess , true , error , callback ) ; writer . seek ( kInitialTestFileContent . length ) ; var blob = new Blob ( [ kTextToWrite ] , { type : 'text/plain' } ) ; writer . write ( blob ) ; } , assertEqAndRunCallback . bind ( null , expectSuccess , false , 'Getting writer for: \'' + entry . fullPath + '\'.' , callback ) ) ; }
Attempts to write |content| to the end of the |entry| and verifies that the
 operation success is as expected.
Attempts to write |content| to the end of the |entry| and verifies that the operation success is as expected .