dat-ecosystem-archive / docs

Documentation resources for dat and the surrounding ecosystem [ DEPRECATED - see https://github.com/hypercore-protocol/new-website/tree/master/guides for similar functionality. More info on active projects and modules at https://dat-ecosystem.org/ ]

Home Page:https://dat-ecosystem-archive.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spec: how to delete files?

bnewbold opened this issue · comments

From experimentation, it looks like deletes are encoded by adding a Node entry with no Stat... but with updated children?

If somebody replies to this issue I can submit a PR updating the paper.

As far as I can tell, deletions are handled by writing a new Node at the old path with no Stat. children for this Node should have all references to the old entry deleted at all hierarchy levels. The new index (aka, the deletion version) should be included as the most recent entry at all currently non-empty directory levels (aka, deleting a single deeply nested file results in a shorter children list than previously).

There is another level of complexity: deleted nodes (aka, empty nodes or "tombstones") can be be garbage collected on any write to the register. This is tricky/hard! Will probably be removed in hyperdb, or left as an optional optimization.