⚖ Compare news

Put up to three stories side by side. Pick IDs from any article URL: /compare?id=123&id=456

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

habrahabr.ru ·Russian Federation · world
Words
36
Chars
237
AI summary
Yes
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 и поведение читателя. Читать далее

Open article