-
Notifications
You must be signed in to change notification settings - Fork 10
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
Io improvements #43
Io improvements #43
Conversation
more effective and cleaner implementation picking
Let readDir append slashes to directory-names
return name.slice(-1) === '/'; | ||
} | ||
|
||
_p.readDirRecursive = obtain.factory( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use it in the red-pill to receive all cps file in the cps directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be an iterator, not a function that might traverse an entire file system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are no iterators yet in ufo js, but I could exclude the method from this module and add it to e.g. metapolator/io/tools
as a stand-alone implementation. That way it would not define any API that are hard to get rid of later.
Despite of that, it's meant to traverse the entire file system, if ask for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Traversing the entire FS is fine, but it doesn't seem sensible to do that by buffering an arbitrarily large directory listing in memory, and taking an arbitrarily long time before doing any useful work (especially as this only exacerbates race conditions).
78e2223
to
a471c42
Compare
No description provided.