@mo_ztt@lemmy.world avatar

mo_ztt

@mo_ztt@lemmy.world

This profile is from a federated server and may be incomplete. Browse more on the original instance.

Is directory monitoring just cursed?

So, I need to monitor a fairly large nested directory tree for changes on Linux. It seems like there are a few different watcher modules that I could use – fsnotify and notify being the main ones, both of which use the inotify interface and attempt to set watches on each individual subdirectory and maintain all their watchers...

mo_ztt,
@mo_ztt@lemmy.world avatar

Just looking briefly it looks like it uses inotify (which definitely won’t work; I don’t have a super heavy write load but I have a total of 124,000 subdirectories to monitor) or can fall back to polling (which I could do myself without having to involve a library).

Why this app is constructed to store its stuff in 124,000 subdirectories is a separate issue but one that I can’t immediately snap my fingers and make go away, unfortunately.

mo_ztt,
@mo_ztt@lemmy.world avatar

I think inotify’s limit is per system… and even if it wasn’t, why would I want to take on the artificial challenge of keeping up with making sure all the watchers are set on the right directories as things change, instead of just recursively monitoring the whole directory? The whole point of asking the question was “hey can something do this for me” as opposed to “hey I’d like the opportunity to code up for myself a solution to this problem.” 🙂

mo_ztt,
@mo_ztt@lemmy.world avatar

Yeah. I think it’s moderately likely that I’ll try to produce a little command-line tool that can do it effectively for deeply nested directories, with some attempt at making it cross platform. To me it’s kind of weird that there’s no stock solution existing to this problem. I get that it’s actually a deceptively difficult problem to solve for a couple of different reasons, but that’s no reason to pass the difficulty on to the programmer instead of just presenting a clean and nice interface.

Update: I looked around for something already-existing, and found watchman and fswatch… IDK, maybe I’ll try to talk one of them into letting me write an fanotify backend for those tools instead. It seems like it’s purely just a Linux issue, and everything is simple on BSD/Mac/Windows, so maybe I’m just lucky.

mo_ztt,
@mo_ztt@lemmy.world avatar

Ads? Or just principle?

mo_ztt,
@mo_ztt@lemmy.world avatar

If it makes you feel any better, I’m watching them with an ad blocker and not currently paying for premium, so it’s costing Google money every time I put this on.

In general I sorta agree with you; do you know of a genuinely libre source that has a wide variety of music available?

mo_ztt,
@mo_ztt@lemmy.world avatar

I have no real idea with Navalnvy, and only dim memories of news reports about Magnitsky which went into a little more detail, but I’ll tell you how I assume it operates: It’s basically mistreatment to the point that it’ll kill you, just slowly. Your cell’s cold all the time, in the arctic winter with no blankets. You get bad food and bad sleep and beatings and no medical care of any kind. Once your body starts to malfunction (Magnitsky started having kidney failure), they go on beating you severely enough to cause additional organ damage, but then just continue to put you in your cell day after day with no medicine. Basically, you’re going to die, but they’re drawing the process out enough that it’s indirectly, because of “medical issues” related to what they’re doing to you, instead of just from blunt force trauma or something. So it’s incredibly painful and long and drawn-out, a slow death of constant suffering from which you can’t escape or get any relief.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • kavyap
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • GTA5RPClips
  • Youngstown
  • everett
  • slotface
  • rosin
  • osvaldo12
  • mdbf
  • ngwrru68w68
  • JUstTest
  • cubers
  • modclub
  • normalnudes
  • tester
  • khanakhh
  • Durango
  • ethstaker
  • tacticalgear
  • Leos
  • provamag3
  • anitta
  • cisconetworking
  • lostlight
  • All magazines