i disagree with answers above.
consider the following practical example:
we open a file for append writing, we make write and do not close file descriptor, after that we make read. the process do not see new data.
create python script
#!/usr/bin/python2
import time
from datetime import datetime
f = open("demo.txt", "a")
while True:
time.sleep(1)
now = datetime.now()
print ("===========")
print ("write to file => date=%s") % (now)
f.write(repr(now))
print ("===========")
print ("read from file :")
f2 = open("demo.txt", "r")
print(f2.read())
f2.close()
f.close()
create new file. fill with with some content.
# touch demo.txt
# echo "Initial content!" > ./demo.txt
launch python scrypt
# ./p1.py
===========
write to file => date=2023-07-06 14:23:14.611576
===========
read from file :
Initial content!
===========
write to file => date=2023-07-06 14:23:15.613440
===========
read from file :
Initial content!
===========
write to file => date=2023-07-06 14:23:16.616518
===========
read from file :
Initial content!
===========
write to file => date=2023-07-06 14:23:17.618961
===========
read from file :
Initial content!
So when we write to a file and try to read from the file we can not see new data that reside in page cache.
Of course when we close write descriptor we finally see new data.
Also if you try to read from another process you also cant see any new data.