function writeText(fileEntry, text) {
        var result = new $.Deferred();
        
        fileEntry.createWriter(function (fileWriter) {
            fileWriter.onwriteend = function (e) {
                result.resolve();
            };
            fileWriter.onerror = function (err) {
                result.reject(err);
            };

            // TODO (issue #241): NativeFileSystem.BlobBulder
            fileWriter.write(text);
        });
        
        return result.promise();
    }
Asynchronously writes a file as UTF-8 encoded text.
@param {!FileEntry} fileEntry
@param {!string} text
@return {$.Promise} a jQuery promise that will be resolved when
file writing completes, or rejected with a FileError.