{"id":19177010,"url":"https://github.com/joomcode/efsw","last_synced_at":"2025-10-13T03:41:22.981Z","repository":{"id":29574342,"uuid":"33113966","full_name":"joomcode/efsw","owner":"joomcode","description":"Git mirror of https://bitbucket.org/SpartanJ/efsw","archived":false,"fork":false,"pushed_at":"2015-11-05T08:21:50.000Z","size":11209,"stargazers_count":1,"open_issues_count":1,"forks_count":2,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-23T01:16:59.053Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"prscX/react-native-popover-menu","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joomcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-30T09:22:53.000Z","updated_at":"2018-12-20T10:23:49.000Z","dependencies_parsed_at":"2022-09-03T17:51:56.819Z","dependency_job_id":null,"html_url":"https://github.com/joomcode/efsw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joomcode/efsw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomcode%2Fefsw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomcode%2Fefsw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomcode%2Fefsw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomcode%2Fefsw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joomcode","download_url":"https://codeload.github.com/joomcode/efsw/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joomcode%2Fefsw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274996705,"owners_count":25387926,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-13T02:00:10.085Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2024-11-09T10:31:35.320Z","updated_at":"2025-10-13T03:41:17.946Z","avatar_url":"https://github.com/joomcode.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Entropia File System Watcher\n============================\n**efsw** is a C++ cross-platform file system watcher and notifier.\n\n**efsw** monitors the file system asynchronously for changes to files and directories by watching a list of specified paths, and raises events when a directory or file change.\n\n**efsw** supports recursive directories watch, tracking the entire sub directory tree.\n\n**efsw** currently supports the following platforms:\n\n* Linux via [inotify](http://en.wikipedia.org/wiki/Inotify)\n\n* Windows via [I/O Completion Ports](http://en.wikipedia.org/wiki/IOCP)\n\n* Mac OS X via [FSEvents](http://en.wikipedia.org/wiki/FSEvents) or [kqueue](http://en.wikipedia.org/wiki/Kqueue)\n\n* FreeBSD/BSD via [kqueue](http://en.wikipedia.org/wiki/Kqueue)\n\n* OS-independent generic watcher\n(polling the disk for directory snapshots and comparing them periodically)\n\nIf any of the backend fails to start by any reason, it will fallback to the OS-independent implementation.\nThis should never happen, except for the Kqueue implementation, see `Platform limitations and clarifications`.\n\n**Code License**\n--------------\n[MIT License](http://www.opensource.org/licenses/mit-license.php)\n\n**Some example code:**\n--------------------\n\n    :::c++\n\t// Inherits from the abstract listener class, and implements the the file action handler\n\tclass UpdateListener : public efsw::FileWatchListener\n\t{\n\tpublic:\n\t\tUpdateListener() {}\n\n\t\tvoid handleFileAction( efsw::WatchID watchid, const std::string\u0026 dir, const std::string\u0026 filename, efsw::Action action, std::string oldFilename = \"\" )\n\t\t{\n\t\t\tswitch( action )\n\t\t\t{\n\t\t\tcase efsw::Actions::Add:\n\t\t\t\tstd::cout \u003c\u003c \"DIR (\" \u003c\u003c dir \u003c\u003c \") FILE (\" \u003c\u003c filename \u003c\u003c \") has event Added\" \u003c\u003c std::endl;\n\t\t\t\tbreak;\n\t\t\tcase efsw::Actions::Delete:\n\t\t\t\tstd::cout \u003c\u003c \"DIR (\" \u003c\u003c dir \u003c\u003c \") FILE (\" \u003c\u003c filename \u003c\u003c \") has event Delete\" \u003c\u003c std::endl;\n\t\t\t\tbreak;\n\t\t\tcase efsw::Actions::Modified:\n\t\t\t\tstd::cout \u003c\u003c \"DIR (\" \u003c\u003c dir \u003c\u003c \") FILE (\" \u003c\u003c filename \u003c\u003c \") has event Modified\" \u003c\u003c std::endl;\n\t\t\t\tbreak;\n\t\t\tcase efsw::Actions::Moved:\n\t\t\t\t\tstd::cout \u003c\u003c \"DIR (\" \u003c\u003c dir \u003c\u003c \") FILE (\" \u003c\u003c filename \u003c\u003c \") has event Moved from (\" \u003c\u003c oldFilename \u003c\u003c \")\" \u003c\u003c std::endl;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstd::cout \u003c\u003c \"Should never happen!\" \u003c\u003c std::endl;\n\t\t\t}\n\t\t}\n\t};\n\n\t// Create the file system watcher instance\n    // efsw::FileWatcher allow a first boolean parameter that indicates if it should start with the generic file watcher instead of the platform specific backend\n\tefsw::FileWatcher * fileWatcher = new efsw::FileWatcher();\n\n\t// Create the instance of your efsw::FileWatcherListener implementation\n\tUpdateListener * listener = new UpdateListener();\n\n\t// Add a folder to watch, and get the efsw::WatchID\n\t// It will watch the /tmp folder recursively ( the third parameter indicates that is recursive )\n\t// Reporting the files and directories changes to the instance of the listener\n\tefsw::WatchID watchID = fileWatcher-\u003eaddWatch( \"/tmp\", listener, true );\n\n    // Adds another directory to watch. This time as non-recursive.\n    efsw::WatchID watchID2 = fileWatcher-\u003eaddWatch( \"/usr\", listener, false );\n\n\t// Start watching asynchronously the directories\n\tfileWatcher.watch();\n\n\t// Remove the second watcher added\n    // You can also call removeWatch by passing the watch path ( it must end with an slash or backslash in windows, since that's how internally it's saved )\n\tfileWatcher-\u003eremoveWatch( watchID2 );\n\t\n**Dependencies**\n--------------\nNone :)\n\n**Compiling**\n------------\nTo generate project files you will need to [download and install](http://industriousone.com/premake/download) [Premake](http://industriousone.com/what-premake)\n\nThen you can generate the project for your platform just going to the project directory where the premake4.lua file is located and then execute:\n\n`premake4 gmake` to generate project Makefiles, then `cd make/*YOURPLATFORM*/`, and finally `make` or `make config=release` ( it will generate the static lib, the shared lib and the test application ).\n\nor \n\n`premake4 vs2010` to generate Visual Studio 2010 project.\n\nor\n\n`premake4 xcode4` to generate Xcode 4 project.\n\nThere is also a cmake file that i don't oficially support but it works just fine, provided by [Mohammed Nafees](https://bitbucket.org/binaryking).\n\n**Platform limitations and clarifications**\n-------------------------------------------\n\nDirectory paths are expected to be encoded as UTF-8 strings in all platforms.\n\nhandleFileAction returns UTF-8 strings in all platforms.\n\nWindows and FSEvents Mac OS X implementation can't follow symlinks ( it will ignore followSymlinks() and allowOutOfScopeLinks() ).\n\nKqueue implementation is limited by the maximun number of file descriptors allowed per process by the OS, in the case of reaching the file descriptors limit ( in BSD around 18000 and in OS X around 10240 ) it will fallback to the generic file watcher.\n\nOS X will only use Kqueue if OS X version is below to 10.5, and this implementation needs to be compiled separately from the OS X \u003e= 10.5 implementation. Since there's no way to compile FSEvents backend in OS X below 10.5.\n\nFSEvents for OS X Lion and beyond in some cases will generate more actions that in reality ocurred, since fine-grained implementation of FSEvents doesn't give the order of the actions retrieved, in some cases i need to guess/aproximate the order of them.\n\nGeneric watcher relies on the inode information to detect file and directories renames/move. Since Windows has no concept of inodes as Unix platforms do, there is no current reliable way of determining file/directory movement on Windows without help from the Windows API ( this is replaced with Add/Delete events ).\n\nLinux versions below 2.6.13 are not supported, since inotify wasn't implemented yet. I'm not interested in support older kernels, since i don't see the point. If someone needs this open an issue in the issue tracker and i may consider implenent a dnotify backend.\n\nOS-independent watcher, Kqueue and FSEvents for OS X below 10.5 keep cache of the directories structures, to be able to detect changes in the directories. This means that there's a memory overhead for this backends.\n\n**Useful information**\n--------------------\nThe project also comes with a C API wrapper, contributed by [Sepul Sepehr Taghdisian](https://bitbucket.org/sepul).\n\nThere's a string manipulation class not exposed in the efsw header ( efsw::String ) that can be used to make string encoding conversion.\n\n\n**Clarifications**\n----------------\n\nThis software started as a fork of the [simplefilewatcher](http://code.google.com/p/simplefilewatcher/) by James Wynn (james[at]jameswynn.com), [MIT licensed](http://www.opensource.org/licenses/mit-license.html).\n\nThe icon used for the project is part of the [Haiku®'s Icons](http://www.haiku-inc.org/haiku-icons.html), [MIT licensed](http://www.opensource.org/licenses/mit-license.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomcode%2Fefsw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoomcode%2Fefsw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoomcode%2Fefsw/lists"}