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

Streams - from Filesystem #12

Closed
gfwilliams opened this issue Oct 1, 2013 · 2 comments
Closed

Streams - from Filesystem #12

gfwilliams opened this issue Oct 1, 2013 · 2 comments
Assignees

Comments

@gfwilliams
Copy link
Member

The current filesystem implementation only allows reading an entire file. Given the limited memory we need to implement the part of node's filesystem API that allows files to be read a bit at a time:

http://nodejs.org/api/fs.html#fs_fs_open_path_flags_mode_callback

Writing is not such a big deal because we can append - but would be nice to have.

@gfwilliams
Copy link
Member Author

Actually, we need readStream support: http://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options

And importantly we need to support the following (for http):

fs.createReadStream(filename).pipe(response)

This is so that we can send files via http that are bigger than we can fit in RAM. Good use-cases of this are:

  • Serving jquery/images/etc
  • Serving up a file that we've written a log to using appendFile

@gfwilliams gfwilliams self-assigned this May 6, 2014
@gfwilliams
Copy link
Member Author

done now!

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

No branches or pull requests

1 participant