Differences From Artifact [fac79ea11f]:
- File
src/OFStdIOStream.m
— part of check-in
[f9cd4f9cab]
at
2017-06-05 15:51:48
on branch trunk
— OFStream: Don't throw when at end of stream
Instead, let reads return 0 and let writes append after the end. (user: js, size: 6626) [annotate] [blame] [check-ins using]
To Artifact [ed0f11c59f]:
- File
src/OFStdIOStream.m
— part of check-in
[4f36894ce7]
at
2017-06-05 17:36:28
on branch trunk
— Clean up exceptions a little
This removes several initializers that omitted the errNo. Removing those
forces to think about whether there is a meaningful errNo to set instead
of just omitting it. (user: js, size: 6671) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
204 205 206 207 208 209 210 | @throw [OFNotOpenException exceptionWithObject: self]; if (length > LONG_MAX) @throw [OFOutOfRangeException exception]; if ((ret = Read(_handle, buffer, length)) < 0) @throw [OFReadFailedException exceptionWithObject: self | | > | 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | @throw [OFNotOpenException exceptionWithObject: self]; if (length > LONG_MAX) @throw [OFOutOfRangeException exception]; if ((ret = Read(_handle, buffer, length)) < 0) @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: EIO]; #endif if (ret == 0) _atEndOfStream = true; return ret; } |
︙ | ︙ | |||
246 247 248 249 250 251 252 | @throw [OFNotOpenException exceptionWithObject: self]; if (length > SSIZE_MAX) @throw [OFOutOfRangeException exception]; if (Write(_handle, (void *)buffer, length) != (LONG)length) @throw [OFWriteFailedException exceptionWithObject: self | | > | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | @throw [OFNotOpenException exceptionWithObject: self]; if (length > SSIZE_MAX) @throw [OFOutOfRangeException exception]; if (Write(_handle, (void *)buffer, length) != (LONG)length) @throw [OFWriteFailedException exceptionWithObject: self requestedLength: length errNo: EIO]; #endif } #if !defined(OF_WINDOWS) && !defined(OF_MORPHOS) - (int)fileDescriptorForReading { return _fd; |
︙ | ︙ |