Обновил файл, а читатель видит старое: сравнение cp, sed -i и os.replace

habrahabr.ru · world
Full story

A file was updated at the same path, but a process with an open file descriptor kept reading the old version. On a small Linux test setup, the author compared cp, sed -i, and replacement through a temporary file. The comparison looked at access permissions, inode behavior, and what the reader process saw.

Путь к файлу тот же, текст обновился, но процесс с открытым дескриптором продолжает читать старую версию. На небольшом Linux-стенде сравнил cp, sed -i и замену через временный файл: права доступа, inode и поведение читателя. Читать далее

Read full article → Compare