Efficient directory tree-like data structure for virtual file system?

I've already ben able to compress and encrypt each individual file using LZ4 and AES but I need to store the tree information so I was thinking maybe to have a hash table of descriptors, where each entry would have the following information:

  • Name
  • Position (in the binary container)
  • Size (to be able read only the bytes for that particular file)
  • Type (whether it's a directory or a file)
  • Parent
  • Next sibling

Also, if each hash is computed from the full path in the original directory, extracting a single file would require only a binary search. But for traversing a directory or extracting multiple files, the fields for parent and next sibling in the descriptor could be used instead, so no more binary searches are needed after the first descriptor is returned from the hash table.

  • 1
    $\begingroup$ 1) I don't see a question there. 2) It seems that you are well into implementation detail territory. That's probably less suited for Computer Science than Stack Overflow or maybe one of the more specialized sites. $\endgroup$ – Raphael Apr 12 '18 at 22:23

You must log in to answer this question.

Browse other questions tagged .