There are two scenarios:
- The user starts reading before starting to write the file.
- The user starts reading after starting to write the file
In the first scenario, the user usually reads the old file (but this may vary depending on different file systems). Please note that you can modify several files that are related to each other, in which case the user may have incompatible versions of the files (for example, one file from version 1.1, which suddenly includes a file from version 1.2).
In another scenario, the user will read a partial file as described by hakre.
There are FTP servers that download the entire file under a temporary name, and then rename it when it is fully downloaded.
There are ways to completely avoid these problems, for example, by closing the site at boot time. If you have a balanced load level, you can delete one server after another and make updates offline without closing the website.
source share