Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Does it keep working when files get overwritten by moving another over it, like some Linux text editors do?


I should test this. I haven’t seen a problem with that so far in my personal usage, so I’m inclined to say probably.

That’s a good test case. I’ll make an issue.


This was a case that tripped me up when using Qt's QFileSystemWatcher. Many apps implement "atomic updates" to files by writing out to a new file (e.g. foo.txt.temp), then moving that file on top of the old one. As far as QFileSystemWatcher was concerned, the old file was deleted and its job is done (just because the new one has the same name doesn't mean it's the same file). So you have to watch the parent directory and manually implement checking for a specific file by name when the parent directory's contents changed.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: