Screenshot showing how the directory last-modified timestamp changes each time a file underneath it is added, renamed and then removed.

I’m currently working on a build tool, which does caching based on the last-modified timestamp of files. And yeah, man, I was prepared for a world of pain, where I’d have to store a list of all files, so I could tell when one of them disappears.
I probably would’ve also had to make up some non-existent last-modified timestamp to try to pretend I know when that file got deleted. I figured, there’s no way to ask the deleted file when it got deleted, because it doesn’t exist anymore.

Thank you, to whomever had that smart idea to design it like that. I can just take the directory last-modified timestamp now, if it’s the highest value.
In fact, my implementation accidentally does this correct already. That’s how I found out. 🫠

    • Ephera@lemmy.mlOP
      link
      fedilink
      English
      arrow-up
      2
      ·
      11 days ago

      I don’t think, inotify works for me, because I don’t have a continuously running process. My users rather just run some build command and then I go and check, if any input files changed since the last run.