We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 98ec85f + 4a288bc commit e8ad6a8Copy full SHA for e8ad6a8
src/libstd/io/fs.rs
@@ -236,10 +236,15 @@ impl File {
236
})
237
}
238
239
- /// Tests whether this stream has reached EOF.
+ /// Returns true if the stream has reached the end of the file.
240
///
241
/// If true, then this file will no longer continue to return data via
242
/// `read`.
243
+ ///
244
+ /// Note that the operating system will not return an `EOF` indicator
245
+ /// until you have attempted to read past the end of the file, so if
246
+ /// you've read _exactly_ the number of bytes in the file, this will
247
+ /// return `false`, not `true`.
248
pub fn eof(&self) -> bool {
249
self.last_nread == 0
250
0 commit comments