in reply to Need directory scheme to store 400,000 images
That is, not repeating the whole prefix up that point. You can then easily turn a simple filename into a file-and-directory thing with this:1/2/3/123.jpg 8/6/7/8675309.jpg
(adjust the "3" to a deeper directory hierarchy as desired). This will put a short filename - like 12.jpg - into a higher level directory than the other files (12.jpg becomes 1/2/12.jpg); if that's not desired, consider using a filename like 00000012.jpg instead of 12.jpg.my $fullpath = $file; # Not just the number, but e.g. "7893.jpg" $fullpath =~ s|(\w{1,3}).*|join('/',split(//,$1),$&)|e or die "Bad filename $file";
On a small scale (1 initial letter), this is the way the terminfo database files are stored, and is also pretty much how Debian organizes their packages on their ftp sites.
But I'd personally go with the ReiserFS suggestion myself, assuming you have full control of the target box.
|
|---|