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

Io improvements #43

Merged
merged 5 commits into from
Nov 25, 2014
Merged

Io improvements #43

merged 5 commits into from
Nov 25, 2014

Conversation

graphicore
Copy link
Owner

No description provided.

return name.slice(-1) === '/';
}

_p.readDirRecursive = obtain.factory(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Owner Author

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.

Copy link
Contributor

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.

Copy link
Owner Author

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.

Copy link
Contributor

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).

graphicore added a commit that referenced this pull request Nov 25, 2014
@graphicore graphicore merged commit 27b584a into master Nov 25, 2014
@graphicore graphicore deleted the io-improvements branch November 25, 2014 13:27
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

Successfully merging this pull request may close these issues.

None yet

2 participants