Skip to content
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

rerooted FS missing some functions #31

Closed
neerolyte opened this issue May 11, 2013 · 2 comments
Closed

rerooted FS missing some functions #31

neerolyte opened this issue May 11, 2013 · 2 comments

Comments

@neerolyte
Copy link
Contributor

I'm not sure if I'm doing it wrong (an example in the docs would be great), but when I simply reroot() a FS the rerooted version is missing some functions, e.g.:

var FS = require('q-io/fs');

function checkFuncs(obj) {
    checkFunc(obj, 'makeDirectory');
    checkFunc(obj, 'makeTree');
}
function checkFunc(obj, name) {
    console.log(name + ": " + (obj[name]?"exists":"missing"));
}

console.log("Main FS:");
checkFuncs(FS);

FS.reroot('/')
.then(function(fs) {
    console.log("Rerooted FS:");
    checkFuncs(fs);
});

produces:

$ node rerooted_test.js 
Main FS:
makeDirectory: exists
makeTree: exists
Rerooted FS:
makeDirectory: missing
makeTree: exists

This causes problems in places because if I call makeTree() on a rerooted FS it fails because it will eventually call this.makeDirectory() internally (which isn't a function).

So am I doing something wrong or is this just a bug?

@kriskowal
Copy link
Owner

It’s a bug, thanks.

@kriskowal
Copy link
Owner

You might check again and please let me know if you encounter further missing methods.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants