块角
how does O.S know that writer is still writing. ?... What is workflow of EOF for file(closing file handle like ^D or ^z) ? what happens if EOF is never written ?
如果读者阅读率比作家写作速度快,会怎样? 汇率错配会导致僵局吗?
其他不想要的情况又会是什么?
O. S 读取文件时如何计算 EOF?
- 尼基尔
P. S. : 当前操作系统是窗口, 但我不介意在 unix 上学习同样有趣的功能 。
块角
<强度 > 更多编辑和关于问题 强度 > 的更多信息
现在我知道EOF不是字符, 所以它不能写在文件的数据上。 IF O. S. 使用文件大小来决定 EOF, 就像 @saurabh 指点的一样 。
( & gt;) 读取 < / 强 > 时 < 强 > EOF (可能根据文件大小确定,文件大小将存储在相应文件系统的驱动器表格中) )
- So does process keeps polling File table for file size to determine EOF as there could be cases of not-fixed files size.
- To my little knowledge, EOF is encountered when you read beyond the EOF(in our case file-size). Assume a situation where writer is writing intermittently and reader is reading blocks. SO if reader tries to read more than the available chunk would EOF be thrown ? But Writer has not signalled EOF yet ?