Bump version. Rebuild artifacts.

This commit is contained in:
Alan Kligman 2014-02-19 12:59:03 -05:00
parent 3d57be4858
commit ed206d68d8
3 changed files with 48 additions and 7 deletions

45
dist/filer.js vendored
View File

@ -4576,6 +4576,46 @@ define('src/fs',['require','nodash','encoding','src/path','src/path','src/path',
} }
} }
function replace_data(context, ofd, buffer, offset, length, callback) {
var fileNode;
function return_nbytes(error) {
if(error) {
callback(error);
} else {
callback(null, length);
}
}
function update_file_node(error) {
if(error) {
callback(error);
} else {
context.put(fileNode.id, fileNode, return_nbytes);
}
}
function write_file_data(error, result) {
if(error) {
callback(error);
} else {
fileNode = result;
var newData = new Uint8Array(length);
var bufferWindow = buffer.subarray(offset, offset + length);
newData.set(bufferWindow);
ofd.position = length;
fileNode.size = length;
fileNode.mtime = Date.now();
fileNode.version += 1;
context.put(fileNode.data, newData, update_file_node);
}
}
context.get(ofd.id, write_file_data);
}
function write_data(context, ofd, buffer, offset, length, position, callback) { function write_data(context, ofd, buffer, offset, length, position, callback) {
var fileNode; var fileNode;
var fileData; var fileData;
@ -4607,7 +4647,8 @@ define('src/fs',['require','nodash','encoding','src/path','src/path','src/path',
if(fileData) { if(fileData) {
newData.set(fileData); newData.set(fileData);
} }
newData.set(buffer, _position); var bufferWindow = buffer.subarray(offset, offset + length);
newData.set(bufferWindow, _position);
if(undefined === position) { if(undefined === position) {
ofd.position += length; ofd.position += length;
} }
@ -5696,7 +5737,7 @@ define('src/fs',['require','nodash','encoding','src/path','src/path','src/path',
var ofd = new OpenFileDescription(fileNode.id, flags, 0); var ofd = new OpenFileDescription(fileNode.id, flags, 0);
var fd = fs.allocDescriptor(ofd); var fd = fs.allocDescriptor(ofd);
write_data(context, ofd, data, 0, data.length, 0, function(err2, nbytes) { replace_data(context, ofd, data, 0, data.length, function(err2, nbytes) {
if(err2) { if(err2) {
return callback(err2); return callback(err2);
} }

8
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -2,7 +2,7 @@
"name": "filer", "name": "filer",
"description": "Node-like file system for browsers", "description": "Node-like file system for browsers",
"keywords": ["fs", "node", "file", "system", "browser", "indexeddb", "idb", "websql"], "keywords": ["fs", "node", "file", "system", "browser", "indexeddb", "idb", "websql"],
"version": "0.0.4", "version": "0.0.5",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)", "author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "http://js-platform.github.io/filer", "homepage": "http://js-platform.github.io/filer",
"bugs": "https://github.com/js-platform/filer/issues", "bugs": "https://github.com/js-platform/filer/issues",