Skip to content

Commit e8ad6a8

Browse files
committed
auto merge of rust-lang#16578 : steveklabnik/rust/gh16239, r=pcwalton
Fies rust-lang#16239.
2 parents 98ec85f + 4a288bc commit e8ad6a8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/libstd/io/fs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,15 @@ impl File {
236236
})
237237
}
238238

239-
/// Tests whether this stream has reached EOF.
239+
/// Returns true if the stream has reached the end of the file.
240240
///
241241
/// If true, then this file will no longer continue to return data via
242242
/// `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`.
243248
pub fn eof(&self) -> bool {
244249
self.last_nread == 0
245250
}

0 commit comments

Comments
 (0)