Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

File monitor: deliver only watched paths with es_invert_muting?

Open
#110 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
objective-c

Research direction

Start with FileMonitor.m:96 and Monitor.m:602-616, then inspect how the watched prefixes and file/process events are matched. Evaluate the proposed ES_MUTE_INVERSION_TYPE_TARGET_PATH behavior, including renames into watched directories and whether KERN_PROCARGS2 can replace exec/exit subscriptions. Done means the monitor avoids unnecessary events without creating a silent gap in watched-path coverage.

Written by the indexing model from the issue text.

Description

On macOS 14+ the file monitor only alerts on a few prefixes (/Library/Extensions/, /System/Library/Extensions/, /private/var/at/tabs/), since launchd and login items moved to BTM events. But it still receives every create, write and rename on the machine, plus every exec and exit, and builds a File and Process object for each one before matching against the watch list (FileMonitor.m:96, Monitor.m:602-616).

On my machine (BlockBlock 2.5.2, macOS 15.7.3, M4 Max) the daemon averages about 21% of a core around the clock, and 0.3-0.8 of a core during builds and test runs. I measured roughly 2.4 µs per write and 130 µs per exec on a busy machine. Notarization and Block Scripts are off, so this is the file monitor.

Would you consider es_invert_muting(client, ES_MUTE_INVERSION_TYPE_TARGET_PATH) (macOS 13+) with the watched prefixes muted in, so the kernel only delivers events for paths BlockBlock can alert on? The exec/exit subscription seems to exist only to keep arguments for alert text, so reading the writer's arguments at alert time (KERN_PROCARGS2) could let that go too.

I understand there may be security reasons not to do this. A prefix list that drifts out of sync with the watch list would be a silent blind spot, and renames into a watched directory need care. If that's the reason it works this way, a note here would help others who hit the same cost (#35 looks related).

Dominant language
Objective-C
Stars
859
Forks
50
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from objective-see/BlockBlock

All issues in objective-see/BlockBlock

Similar issues

More Objective-C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.