

Yeah, good point. It also doesn’t update when the content of a file changes. So, in order to detect a change in a directory, you have to walk all the files and sub-directories and the directory itself to get the last-modified timestamp for each of them. Then determine the highest last-modified and compare it to what you measured in a previous run. If they differ, a change happened.
https://en.wikipedia.org/wiki/Attacus_atlas