Two principal classes of file operations are considered:
Access to file content using explicit operations involves a buffer shared by the accessor and file provider. Two indexes or pointers within the buffer are employed, indicating the following:
Meanwhile, the writing of data causes the data_start pointer to advance, with the written data appearing behind the advancing pointer. If the pointer reaches the data_end pointer, it too advances ahead of written data.
Initial state:
buffer |--------| data_start |-> data_end |->
After fs_read:
buffer |=====---| data_start |-> data_end |->
At end of data:
buffer |=====---| data_start |-> data_end |->
(A read attempt causes position change and return to initial state, followed by fs_read.)
Initial state:
buffer |--------| data_start |-> data_end |->
After client write:
buffer |***-----| data_start |-> data_end |->
At end of buffer:
buffer |********| data_start |-> data_end |->
(Write causes fs_write, position change and return to initial state.)
After fs_read and consumption of some available data:
buffer |======--| data_start |-> data_end |->
Write after read:
buffer |===***--| data_start |-> data_end |->
(Read causes fs_write, position change and return to initial state.)
Access to file content through memory mapping involves the reservation of a virtual address region within which memory accesses cause the retrieval and potential modification of file data.