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 bower_components
.env .env
*~ *~
dist/filer-test.js
dist/filer-issue225.js dist/filer-issue225.js

View File

@ -1,6 +1,6 @@
{ {
"name": "filer", "name": "filer",
"version": "0.0.29", "version": "0.0.32",
"main": "dist/filer.js", "main": "dist/filer.js",
"ignore": [ "ignore": [
"build", "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', '47:EEXIST:file already exists',
//'48:ESRCH:no such process', //'48:ESRCH:no such process',
//'49:ENAMETOOLONG:name too long', //'49:ENAMETOOLONG:name too long',
//'50:EPERM:operation not permitted', '50:EPERM:operation not permitted',
'51:ELOOP:too many symbolic links encountered', '51:ELOOP:too many symbolic links encountered',
//'52:EXDEV:cross-device link not permitted', //'52:EXDEV:cross-device link not permitted',
'53:ENOTEMPTY:directory not empty', '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) { function check_if_file_exists(error, result) {
if(error) { if(error) {
callback(error); callback(error);
@ -3364,7 +3374,7 @@ function unlink_node(context, path, callback) {
if(!_(directoryData).has(name)) { if(!_(directoryData).has(name)) {
callback(new Errors.ENOENT('a component of the path does not name an existing file', name)); callback(new Errors.ENOENT('a component of the path does not name an existing file', name));
} else { } 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", "idb",
"websql" "websql"
], ],
"version": "0.0.29", "version": "0.0.32",
"author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)", "author": "Alan K <ack@modeswitch.org> (http://blog.modeswitch.org)",
"homepage": "http://filerjs.github.io/filer", "homepage": "http://filerjs.github.io/filer",
"bugs": "https://github.com/filerjs/filer/issues", "bugs": "https://github.com/filerjs/filer/issues",