-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
fs.writeSync
truncates long lines
#1541
Comments
(I made/deleted an incorrect comment earlier -- sorry) This only happens for me when |
Maybe this will be useful to someone with familiarity w/ libuv. The last good commit (that can build) was
I'll add that I've experienced this one in the wild--when I encountered it, I thought it was the |
Ok, this is an off-topic, but never do that type of string concatenation in javascript. |
@ChALkeR Sorry for this kind of concatenation. It's for demonstration purposes only. Performance-friendly version would be more complicated obscuring the overall idea of |
I suspect it is caused by libuv/libuv@b197515 but I'm not sure it qualifies as a regression. The tty file descriptor is non-blocking now whenever possible; I don't think the documentation made any promises about the blocking or non-blocking nature of For the record, what happens is a partial write:
You don't have that issue with |
JFYI The issue is also reproducible for me when running |
@bnoordhuis If I keep the event loop alive with a timer, it still does not finish writing. It was my understanding that libuv retries writes (or at least that the |
You mean with |
FWIW, the example works as expected on Windows (10 x64) with io.js 1.8.1 |
@bnoordhuis Sorry for the confusion. There is still a problem here though. You can reproduce this issue with Merging #774 fixes pipes, but not TTYs. For an example of a regression in the wild, see |
Actually a duplicate of #784 |
iojs 1.8.1
Linux Mint 17, x64, 3.13.0-24
Running this script produces a truncated output. Here is a tail of it
... 77530 77536 77542 77548 77554 77560 7
.Replacing
fs.writeSync(process.stdout.fd, buffer, 0, buffer.length, null)
withconsole.log(str)
changes output. Now the full string is output correctly. Tail is... 9964 99970 99976 99982 99988 99994
.The text was updated successfully, but these errors were encountered: