Is there a way to force the write command to block until all bytes have been written?
1
vote
2
answers
1078
views
Per the man pages , the write command "writes up to count bytes" and then returns the actual number of bytes written. Thus if I wanted to ensure all bytes were written to the file descriptor, I would need to put the write within a loop and monitor that all bytes have been written.
However, is there a way to configure the file descriptor such that writes block until *all* bytes have been written?
Edit* I'm writing to pipes if that makes any difference.
Asked by Izzo
(1013 rep)
Oct 20, 2022, 02:27 AM
Last activity: Oct 21, 2022, 08:03 AM
Last activity: Oct 21, 2022, 08:03 AM