3 ms·
> Why would the app not know that files are changed? Any development environment nowadays may check for touched files and re-parses them on the fly, for example
by The_Colonel 7y ago
> Why would the app not know that files are changed? Any development environment nowadays may check for touched files and re-parses them on the fly, for example for instant preview of web pages.
Modern OS provide APIs to watch file changes (on Linux e.g. it's inotify). However:
1) Does not work when your app is not running. When your app starts up it needs to rescan all files.
2) Does not scale well - watching files is expensive and OS usually have usage limits.
IDEs provide a great example since they need to solve essentially the same problem - when my Intellij starts up it spends a while until it scans all the changed files (to do that it must go through all of them). After that it starts complaining that my inotify OS limit is too low and it can't watch all the files in the project.
All this is fine for lightweight use. But if you're serious with using your knowledge base, you'll run into tens of thousands of items in the course of few years.