add filer-test.js to repo

This commit is contained in:
Alan K 2014-09-30 16:16:15 -04:00
parent c113907f62
commit 04d612c97b
6 changed files with 16629 additions and 9 deletions

1
.gitignore vendored
View File

@ -2,5 +2,4 @@ node_modules
bower_components
.env
*~
dist/filer-test.js
dist/filer-issue225.js

View File

@ -1,6 +1,6 @@
{
"name": "filer",
"version": "0.0.29",
"version": "0.0.32",
"main": "dist/filer.js",
"ignore": [
"build",

16611
dist/filer-test.js vendored Normal file

File diff suppressed because it is too large Load Diff

14
dist/filer.js vendored
View File

@ -2264,7 +2264,7 @@ var errors = {};
'47:EEXIST:file already exists',
//'48:ESRCH:no such process',
//'49:ENAMETOOLONG:name too long',
//'50:EPERM:operation not permitted',
'50:EPERM:operation not permitted',
'51:ELOOP:too many symbolic links encountered',
//'52:EXDEV:cross-device link not permitted',
'53:ENOTEMPTY:directory not empty',
@ -3356,6 +3356,16 @@ function unlink_node(context, path, callback) {
}
}
function check_if_node_is_directory(error, result) {
if(error) {
callback(error);
} else if(result.mode === 'DIRECTORY') {
callback(new Errors.EPERM('unlink not permitted on directories', name));
} else {
update_file_node(null, result);
}
}
function check_if_file_exists(error, result) {
if(error) {
callback(error);
@ -3364,7 +3374,7 @@ function unlink_node(context, path, callback) {
if(!_(directoryData).has(name)) {
callback(new Errors.ENOENT('a component of the path does not name an existing file', name));
} else {
context.getObject(directoryData[name].id, update_file_node);
context.getObject(directoryData[name].id, check_if_node_is_directory);
}
}
}

8
dist/filer.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -11,7 +11,7 @@
"idb",
"websql"
],
"version": "0.0.29",
"version": "0.0.32",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "http://filerjs.github.io/filer",
"bugs": "https://github.com/filerjs/filer/issues",