rojo/crates/memofs
Noah Peeters 1d2dc326a0 Stop losing file changes on macOS when files are deleted (AI-assisted)
Vfs::commit_event calls StdBackend::unwatch for every removed path, but only the roots passed to
watch() are watched. unwatch forwarded every path to notify anyway, and notify's FSEvents backend
handles an unwatch by tearing down and restarting its event stream; whatever changed during the
restart was never reported. Deleting files while others change (a git checkout, a branch switch)
therefore dropped events, and the served tree went stale without any error.

Only call the watcher's unwatch for paths that are actually watched. The new test deletes 100
files (calling unwatch on each, as commit_event does) while creating 100 others: before this
change macOS reported 1 of the 100 creations, now all 100.
2026-10-19 17:09:52 +02:00
..
src Stop losing file changes on macOS when files are deleted (AI-assisted) 2026-10-19 17:09:52 +02:00
Cargo.toml Fix windows verbatim paths (#1295) 2026-07-05 11:26:35 -07:00
CHANGELOG.md Release v7.7.0 (#1286) 2026-07-01 17:59:58 -07:00
LICENSE.txt Move memofs and rojo-insta-ext into crates folder 2022-05-26 04:23:44 -04:00
README.md Move memofs and rojo-insta-ext into crates folder 2022-05-26 04:23:44 -04:00
README.tpl Move memofs and rojo-insta-ext into crates folder 2022-05-26 04:23:44 -04:00

memofs

Crates.io

Implementation of a virtual filesystem with a configurable backend and file watching.

memofs is currently an unstable minimum viable library. Its primary consumer is Rojo, a build system for Roblox.

Current Features

  • API similar to std::fs
  • Configurable backends
    • StdBackend, which uses std::fs and the notify crate
    • NoopBackend, which always throws errors
    • InMemoryFs, a simple in-memory filesystem useful for testing

Future Features

  • Hash-based hierarchical memoization keys (hence the name)
  • Configurable caching (write-through, write-around, write-back)

License

memofs is available under the terms of the MIT license. See LICENSE.txt or https://opensource.org/licenses/MIT for more details.