Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: What data structure/db should I use for storing the file tree structure?
1 point by code_devil on Oct 17, 2011 | hide | past | favorite | 1 comment
I am trying to write an application(I am using python) to have a copy of a remote machines directory structure in my local machine (not the actual content of the files in the remote machine).

Once I store it in my local machine, I want to be be able to perform the following operations on my local copy of the tree structure

"ls"

"ls /etc"

"ls /etc/bin/yahoo"

and see the listing. Also if I change/add a dir/file name in the remote machine, I want to have the ability to easily update it in my local data structure.




You don't specify any performance requirements, so take a look at this:

http://en.wikipedia.org/wiki/Nested_set_model

You will be able to update, but it will not be efficient.

Also - questions of this type are more appropriate for StackOverflow than HackerNews.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: