[ad_1]
I was wondering which operation would be more expensive in terms of disk block transfers from the two operations that I’ll present below present below(All this under the assumption that no relevant data exists in the buffer cache). Is opening a file using the open() syscall more expensive than reading one block using read() syscall?
It seems to me more sense that the open() operation would be more expensive because in this case all the blocks of the file from the disk should be loaded directly into the physical memory (assuming the physical memory is not too small for the file size), while on the other hand if I want to read only one block of the file using read() syscall then I’m going to have to load from the disk into the physical memory only one block.
If anyone can make this matter clear to me, I will be more than happy.
[ad_2]