[英]Reading file using fread in C
I lack formal knowledge in Operating systems and C. My questions are as follows. 我缺乏有关操作系统和C的正式知识。我的问题如下。
fread
in C, does the entire disk block containing that byte is brought into memory or just the byte? 当我尝试使用C中的fread
读取文件的第一个单字节时,包含该字节的整个磁盘块是否都带入内存或仅带入字节? Here's my answers 这是我的答案
setvbuffer
can change that. setvbuffer
可以改变这一点。 FILE
structure. 它是FILE
结构的一部分。 This is implementation (compiler) specific so don't touch it. 这是特定于实现(编译器)的,因此请不要触摸它。 The above caching is used by the C runtime library not the OS. 上面的缓存由C运行时库而不是OS使用。 The OS may or may not have disk caching and is a separate mechanism. 操作系统可能具有磁盘缓存,也可能没有磁盘缓存,并且是单独的机制。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.