Honestly, if you're unable to do this in 0.10, I'd say just copy out
the implementation into a module, and make whatever changes you want
to it.  Fs streams are the simplest ones, so it's not so bad.

You might be able to subclass and just clobber the method that is
calling close.  I don't remember how that's implemented.

But it'd be better to take that effort and spend it on upgrading
instead.  It might be easier than you think.  At the very least,
making a correctly-performing 0.10 stream is hella easier with the
readable-stream module than rolling your own 0.8-style stream.


On Tue, Apr 23, 2013 at 7:52 AM, Matt <[email protected]> wrote:
> Note: I'm specifically asking about v0.8 streams right now - I have too much
> code in v0.8 streams to re-write for the new v0.10 streams just yet.
>
> I'm looking for a way that I can fsync a WriteStream before it is
> fs.close()d. I thought I could just use {end: false} and watch for the end
> of the read stream, fsync(ws.fd), then close the stream in the callback. But
> the stream might have a queue of data waiting to be written (the _queue
> entry in the ws) so I could fsync too soon.
>
> Then I thought I could subclass WriteStream and overload the end() method,
> but doing that suffers from the same queue problem, and I can't add an
> fs.fsync into the queue because the WriteStream flush() method doesn't
> support it.
>
> Not sure what else to try now.
>
> Thoughts?
>
> --
> --
> 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.
>
>

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


Reply via email to