-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Strange behaviour when reading from file stream using resume/pause? #537
Comments
On Linux, the same thing happens (node v0.3.2-pre): Without: With:
Although in some cases, it actually seems to work the way it should. Might be some kind of race condition... |
Strangely, piping seems to work the way it should:
|
Duplicate of #535. |
#535 is solved, close this issue? |
@isaacs can you close this issue? |
I recently stumbled upon a pretty weird issue with file streams in node v0.3.3-pre (pulled from git master) on OS X (10.6.5). The following script (which should just read in.txt and dump everything to out.txt) leads to different results when the resume/pause pair is commented out:
Without the resume/pause pair, the MD5 of out.txt is exactly equal to the one of in.txt in all cases. However, when running with pause/resume, the MD5 of out.txt is different all the time. Also, I get two 'end' events.
Without resume/pause:
tommy$ md5 in.txt
MD5 (in.txt) = 9c91b3f1cc60b8bf42aec04861ed942f
tommy$ node ./bugtest.js
END of streaming: 4727845 bytes
Error event: Error: EBADF, Bad file descriptor
tommy$ md5 out.txt
MD5 (out.txt) = 9c91b3f1cc60b8bf42aec04861ed942f
With pause/resume:
tommy$ node ./bugtest.js
END of streaming: 4745290 bytes
END of streaming: 4745290 bytes
Also, the EBADF is kind of weird...
The text was updated successfully, but these errors were encountered: