Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have 142 notes in Tomboy but I don't understand why is there such an amount of files and folders created inside the main folder of Tomboy. In there, there are 5 subfolders, named "0", "1"... "4" and in each one of them there are 100 subfolders named:

  • "0", "1", ..., "99", inside folder "0"
  • "100", "101", ..., "199" inside folder "1"
  • and so on...

Inside each subfolder there may be a file or two. In total, nautilus tells me there are about 1300 items inside the folder of Tomboy.

Can someone please explain to me why is this so? My concern is that I sync these notes on Dropbox which, I think, might have a hard time to crawl all these folders for changes, eg. when starting Ubuntu. Correct me please if this isn't true.

share|improve this question
    
Thanks for tagging with /tomboy. I wasn't allowed to create that tag :) –  Dimitris Tzortzis Aug 28 '11 at 14:58
add comment

1 Answer

up vote 1 down vote accepted

That kind of multiple level directory structure is a common solution to speed up file retrieval when you have to handle a large number of files. A lot of other application use that kind of structure to keep some kind of file cache (e.g. firefox, squid).

Instead of a single large directory with all the files, the application create a structure of subdirectories and uses some rule to choose in which directory to put each file. In this way, it is easier and quicker to find the needed file.

Let's do a simple example: If I want to keep a file for each one of my customers. I'll create a directory for each alphabet letter and then, in each one of these directories, a directory for each alphabet letter. Now I can put "DimitrisTzortzis.info" file in the T/D directory.


From this point, I start to do some supposition based only on my experience, because I do not know the details of dropbox and tomboy implementations.

Usually, to manage a large structure of nested subdirectory is easier than to manage a single large directory (at least, on unix filesystems). This should be true also for dropbox so you do not have to worry about this. That "strange" structure will help dropbox to speed up the things.

Unluckily Tomboy directory structure seems to grow when you create new notes and not to shrink when you delete them. This could explain why your structure is so big with so few notes in it.

share|improve this answer
    
Great answer! Thank you very much! It really helped me :) –  Dimitris Tzortzis Sep 1 '11 at 8:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.