{"id":39965079,"url":"https://github.com/qoretechnologies/module-fsevent","last_synced_at":"2026-01-18T21:35:21.031Z","repository":{"id":35178850,"uuid":"39436425","full_name":"qoretechnologies/module-fsevent","owner":"qoretechnologies","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-04T07:35:25.000Z","size":356,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":13,"default_branch":"develop","last_synced_at":"2026-01-06T00:53:19.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qoretechnologies.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-07-21T09:25:23.000Z","updated_at":"2026-01-04T07:35:29.000Z","dependencies_parsed_at":"2025-05-28T19:51:21.575Z","dependency_job_id":"69d4e1e2-bcf4-40b8-8bf5-b1891e7a231e","html_url":"https://github.com/qoretechnologies/module-fsevent","commit_stats":null,"previous_names":["qoretechnologies/module-fsevent"],"tags_count":44,"template":false,"template_full_name":null,"purl":"pkg:github/qoretechnologies/module-fsevent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-fsevent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-fsevent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-fsevent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-fsevent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qoretechnologies","download_url":"https://codeload.github.com/qoretechnologies/module-fsevent/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qoretechnologies%2Fmodule-fsevent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28551202,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-18T21:35:20.969Z","updated_at":"2026-01-18T21:35:21.021Z","avatar_url":"https://github.com/qoretechnologies.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nQore fsevent Module\n===================\n\nA cross-platform filesystem event monitoring module for the Qore programming language.\n\nOVERVIEW\n--------\n\nThe fsevent module provides real-time filesystem monitoring capabilities, allowing\napplications to receive notifications when files and directories are created, modified,\nmoved, or deleted. It wraps the \"Entropia File System Watcher\" (efsw) library.\n\nFeatures:\n - Cross-platform support (Linux, macOS, FreeBSD, Windows)\n - Recursive directory watching\n - Symlink following (optional)\n - Multiple platform-native backends with automatic fallback\n - High-level polling API for delayed event processing\n\nPlatform Backends:\n - Linux: inotify (kernel 2.6.13+)\n - macOS/FreeBSD: kqueue\n - Windows: I/O Completion Ports\n - Generic: Polling-based fallback (all platforms)\n\nQUICK START\n-----------\n\nBasic usage example:\n\n    %requires fsevent\n\n    class MyWatcher inherits FsEvents::AbstractFsWatcher {\n        event(hash\u003cFsEventInfo\u003e event) {\n            printf(\"Event: %s %s%s%s\\n\",\n                ACTION_MAP{event.action},\n                event.dir,\n                event.name,\n                event.old_name ? \" (was: \" + event.old_name + \")\" : \"\");\n        }\n    }\n\n    MyWatcher w();\n    w.addPath(\"/var/log\", True);  # True = recursive\n    while (True) {\n        sleep(1);\n    }\n\nFor delayed event processing (useful for non-atomic file creation):\n\n    %requires FsEventPoller\n\n    class MyPoller inherits AbstractDelayedFsEventPoller {\n        constructor(string path) : AbstractDelayedFsEventPoller(path, {\n            \"minage\": 5,           # Wait 5 seconds after last modification\n            \"mask\": \"*.csv\",       # Only match CSV files\n        }) {}\n\n        fileEvent(hash\u003cFsEventInfo\u003e event) {\n            printf(\"Ready to process: %s\\n\", event.name);\n        }\n    }\n\n    MyPoller p(\"/data/incoming\");\n    p.start();\n\nAPI SUMMARY\n-----------\n\nCore Classes:\n - AbstractFsWatcher: Base class for filesystem monitoring\n   - addPath(string path, bool recursive): Add directory to watch\n   - removePath(int id | string path): Remove watched directory\n   - directories(): List watched directories\n   - event(hash\u003cFsEventInfo\u003e): Abstract callback (override this)\n\nEvent Constants:\n - ADD, DELETE, MODIFIED, MOVED\n - ACTION_MAP: int -\u003e string mapping\n - ACTION_RMAP: string -\u003e int mapping\n\nFsEventInfo Hash:\n - id: Watch ID\n - dir: Directory path\n - name: Filename\n - action: Event type (ADD, DELETE, MODIFIED, MOVED)\n - old_name: Previous name (for MOVED events)\n\nHigh-Level Modules:\n - FsEventPoller: AbstractFsEventPoller, AbstractDelayedFsEventPoller\n - FsEventPollerUtil: DataProvider integration\n\nBUILD INSTRUCTIONS\n------------------\n\nRequirements:\n - Qore development environment (lib and headers) \u003e= 0.9\n - CMake \u003e= 3.0\n - C++11 compiler\n - (optional) Doxygen for API documentation\n\nBuild steps:\n\n    mkdir build\n    cd build\n    cmake -DCMAKE_INSTALL_PREFIX=/path/to/install ..\n    make\n    make install\n\nIf -DCMAKE_INSTALL_PREFIX is not specified, the Qore module directory is used.\n\nTROUBLESHOOTING\n---------------\n\nLinux (inotify):\n - \"Too many open files\" error: Increase inotify limits\n     sysctl fs.inotify.max_user_watches=524288\n     sysctl fs.inotify.max_user_instances=512\n - Check current limits: cat /proc/sys/fs/inotify/max_user_watches\n\nmacOS/BSD (kqueue):\n - Limited by max file descriptors per process\n - Increase with: ulimit -n 4096\n - Falls back to generic watcher if limit reached\n\nWindows:\n - Symlinks are not followed (OS limitation)\n - Remote/network drives may have reduced functionality\n\nGeneric Watcher:\n - Higher CPU usage due to polling\n - Memory overhead for directory caching\n - Used as fallback when native backend fails\n\nTESTS\n-----\n\nTests are located in the \"test\" directory:\n - fsevent.qtest: Core module tests\n - FsEventPoller.qm.qtest: High-level API tests\n\nRun tests:\n    qore test/fsevent.qtest\n    qore test/FsEventPoller.qm.qtest\n\nLICENSE\n-------\n\nDual licensed under LGPL 2.1 or MIT (see COPYING.MIT)\n\nBased on the \"Entropia File System Watcher\" (efsw):\nhttps://github.com/SpartanJ/efsw\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoretechnologies%2Fmodule-fsevent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqoretechnologies%2Fmodule-fsevent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqoretechnologies%2Fmodule-fsevent/lists"}