-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests fail #28
Comments
I wrote a quick-and-dirty patch : --- a/lib/dir.js
+++ b/lib/dir.js
@@ -41,7 +41,9 @@
* Asynchronous dir.
*/
Dir.prototype.rmdir = function() {
- fs.rmdir.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ a.push(function(err){throw Error(err)});
+ fs.rmdir.apply(fs, a);
};
/**
--- a/lib/file.js
+++ b/lib/file.js
@@ -41,7 +41,9 @@
* Asynchronously reads the entire contents of a file.
*/
File.prototype.readFile = function() {
- fs.readFile.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ a.push(function(err){throw Error(err)});
+ fs.readFile.apply(fs, a);
};
/**
@@ -55,7 +57,12 @@
* Asynchronously writes data to a file.
*/
File.prototype.writeFile = function() {
- fs.writeFile.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ if(a.length < 2) {
+ a.push('');
+ }
+ a.push(function(err){throw Error(err)});
+ fs.writeFile.apply(fs, a);
};
/**
@@ -69,7 +76,9 @@
* Asynchronous file open.
*/
File.prototype.open = function() {
- fs.open.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ a.push(function(err){throw Error(err)});
+ fs.open.apply(fs, a);
};
/**
@@ -83,7 +92,9 @@
* Asynchronous close.
*/
File.prototype.close = function() {
- fs.close.apply(fs, Array.prototype.slice.call(arguments));
+ var a = Array.prototype.slice.call(arguments);
+ a.push(function(err){throw Error(err)});
+ fs.close.apply(fs, a);
};
/**
@@ -97,7 +108,9 @@
* Asynchronous unlink.
*/
File.prototype.unlink = function() {
- fs.unlink.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ a.push(function(err){throw Error(err)});
+ fs.unlink.apply(fs, a);
};
/** |
If you create this as a pull request, we can merge it in on GitHub, however only @vesln , who has disappeared for some years, is able to update the published package on NPM. As such, it's probably best to think of this official repository as deprecated. |
@willscott: you can take ownership : write a mail to @vesln, CC to support@npmjs.com. If you don't have any response, you can write a second mail explaining that you're the current maintainer, no GitHub repo changes,... Cheers, |
Transition has occurred, and I should be able to act as maintainer now. I'll work on getting this cleanup into a new version. |
Thanks @willscott ! My proposed patch is quick-and-dirty. I don't know if @@ -55,7 +57,12 @@
* Asynchronously writes data to a file.
*/
File.prototype.writeFile = function() {
- fs.writeFile.apply(fs, this.prepareArgs(arguments));
+ var a = this.prepareArgs(arguments);
+ if(a.length < 2) {
+ a.push('');
+ }
+ a.push(function(err){throw Error(err)});
+ fs.writeFile.apply(fs, a);
};
/** Is there never any data to write ? |
Thanks, for jumpstarting this. v1.0 should address the default arguments issue for the current node fs api. |
Thanks ! I'll upload this to Debian |
Hello,
test reports this now :
The text was updated successfully, but these errors were encountered: