I'm doing a file copy using fs.createReadStream & fs.createWriteStream. When write stream throws an ENOENT error because destination directory doesn't exist, I want to create it, and than re-create and re-pipe the streams.
To do that, first I need to kill & get rid of already existing streams without them causing any more issues and not breaking the app. Currently, I'm doing this: http://hastebin.com/qeketakofi.js Bu I don't know whether some lines inside terminate() are not redundant, or whether I'm not doing something that I should. Node docs are generally quite brief, leaving tons of questions unanswered :/ Also, for the sake of efficiency, is it possible to just recycle the read stream, and pipe it to a new write stream? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
