views:

50

answers:

3

What term should I use to describe situations (or bugs in software) caused by read, write, send, recv doing less work than expected?

For example, write(fd, "123456", 6); may return 3 and we need to write "456" to finish our work.

/* Still in doubt between "short write/read" and "data truncation" after reading answers. */

A: 

I'm not sure it has a specific name. It has to do with buffering and channel availability. For example, when you send over a network there is some sort of a window which you can fill up completely, but if the previous data hasn't been completely sent yet, then right now you can only stream in enough to fill up this window.

Developer Art
+3  A: 

It is called truncation:

http://en.wikipedia.org/wiki/Data_truncation

chibacity
"The bug in program xxx is bad handling of data truncation in writing to the socket" Is it OK?
Vi
"Bug xxx: Data is truncated when written to the socket".
chibacity
"Data gets truncated when written to this filesystem, so the program must call `write` again and again". Good phrase?
Vi
As you are now using this answer in other questions on SO, an accept would be acceptable. :)
chibacity
@chibacity, I've added "short write" as well. I think "truncated" usually means some bad situation or data loss. "short write" is not a bug in general, just the case programs should handle.
Vi
+1  A: 

short write ....

huhu
"short write" vs "truncating when writing". Should I use "truncation on write" when no data loss occurs, just more write calls?
Vi
@Vi: truncation usually implies permanent data loss/removal (you can truncate an existing file = remove some data from its end). Short read/write is just that, read less than was expected, the data is still available, just not processed.
SF.