in reply to What happens to the bytes not read by read() ?
If you close the file handle before they are read the garbage collector will come along and take them to the recycling centre for you. You may end up using them later in the program, but they will have been cleaned and sanitised so you probably won't recognise them.
If they remain unread by the time the program exits the system takes all the bytes back. You don't get a refund.
|
|---|