lib/Ext/device/filesystem/HTML5.js
function(config) {
                if (config.size == null) {
                    Ext.Logger.error('Ext.device.filesystem.FileEntry#write: You must specify a `size` of the file.');
                    return null;
                }

                var me = this;
                //noinspection JSValidateTypes
                this.getEntry(
                    {
                        success: function(fileEntry) {
                            fileEntry.createWriter(
                                function(writer) {
                                    writer.truncate(config.size);
                                    config.success.call(config.scope || me, me);
                                },
                                function(error) {
                                    config.failure.call(config.scope || me, error)
                                }
                            )
                        },
                        failure: function(error) {
                            config.failure.call(config.scope || me, error)
                        }
                    }
                )
            }
function(config) {
                if (config.size == null) {
                    Ext.Logger.error('Ext.device.filesystem.FileEntry#write: You must specify a `size` of the file.');
                    return null;
                }

                var me = this;
                //noinspection JSValidateTypes
                this.getEntry(
                    {
                        success: function(fileEntry) {
                            fileEntry.createWriter(
                                function(writer) {
                                    writer.truncate(config.size);
                                    config.success.call(config.scope || me, me);
                                },
                                function(error) {
                                    config.failure.call(config.scope || me, error)
                                }
                            )
                        },
                        failure: function(error) {
                            config.failure.call(config.scope || me, error)
                        }
                    }
                )
            }
Truncates or extends the file to the specified size in bytes.
If the file is extended, the added bytes are null bytes.

@param {Object} config
The object which contains the following config options:

@param {Number} config.size This is required.
The new file size.

@param {Function} config.success This is optional.
The callback to be called when the file size has been successfully changed.

@param {Function} config.failure This is optional.
The callback to be called when an error occurred.

@param {Object} config.failure.error
The occurred error.

@param {Object} config.scope
The scope object