Trending

World technology news

→
Archive close-up of a hard-drive platter illustrating the physical storage contrast.
crates.ioIn-depth report

boxfs-memfs 0.4.4 releases in-memory file system software with tree snapshots

The Rust package provides an in-memory backend and persistent-tree snapshots for boxfs. Application tests can distinguish a tree version from process lifetime.

·crates.io
Reading progress0%

A tree version is different from a disk copy

boxfs-memfs 0.4.4 reached crates.io on November 29 and has a separate Docs.rs build. The project is described as an in-memory filesystem backend for boxfs with persistent-tree snapshots. Persistent in this context refers to a data structure that can retain versions. It does not by itself establish storage across process restarts. An archive editor might keep its original directory view while adding a file to the current tree. Check both listings while the process is running, then separately test what survives a restart under the application’s configured storage path.

Observe a directory rename

Create two directories, one for inputs and one for generated files. Take a snapshot, rename the first directory and add an empty file to the second. Check that the old view contains the former name and omits the new file. The current tree should reflect both changes. Compare paths as sets unless ordering is part of the application contract. Treat a listing order requirement as a separate test so it cannot obscure a change to the actual entries.

Read file contents from both versions

A path may remain visible after its contents change. Write a short configuration, take a snapshot and update one value. Open the original path through both views and compare the digests. Keep a zero-byte file distinct from a missing file. With larger inputs, measure memory while references to older snapshots remain live, and after they are released. The registry and build receipt do not quantify how much data a particular update shares with the prior tree.

Separate process lifetime from export lifetime

An in-memory backend can suit an editing preview, temporary job or test environment. An application that must reopen work after exit needs a defined export boundary. Save a digest of the exported file, restart the process and compare the digest of what it can read back. Seeing a path in the current memory tree does not demonstrate that data reached the chosen destination. If writes can overlap with export, record which tree version produced the artifact.

Run a bounded memory fixture

Start with ten directories and a few dozen files. Measure a run that holds every snapshot and another that keeps only the final one. Record the live snapshot count as well as the file distribution and sampling time. Released allocations may still be retained by the allocator, so a resident process measurement answers a different question from counting live tree objects. Choose both metrics if memory retention matters to the deployment.

Tie the build record to a reproducible test

The build receipt distinguishes the exact release under evaluation. Extend the fixture with a deleted path and define what the previous snapshot should return. Write the expectation through the application’s normal read entry point. This makes the fixture useful even if the internal filesystem backend changes.

Photo · Mk2010 / Wikimedia Commons ↗ · CC BY 4.0

Sources and verification
Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

What would you change first for maintainability and testing in your own project?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.