Cody Fendant has asked for the wisdom of the Perl Monks concerning the following question:

This is hard to google for—is there a conventional name for this format: you've got too many files to put them all in $directory so you put them in $directory slash substring($name,0,1) slash substring($name,1,1) so that for example your file foo.jpg is found in /var/images/f/o/foo.jpg ?

Replies are listed 'Best First'.
Re: Is there a name for this directory format where 'foo.jpg' is in '/img/f/o/'?
by kcott (Archbishop) on Mar 03, 2023 at 20:53 UTC

    G'day Cody Fendant,

    I suspect the "conventional name" you're looking for is trie. It's not limited to pathnames and would be used slightly differently: .../f/fo/foo.jpg (not .../f/o/foo.jpg). Consider CPAN tarballs; e.g. https://cpan.metacpan.org/authors/id/T/TI/TIMB/DBI-1.643.tar.gz with '.../T/TI/TIMB/...'.

    — Ken

Re: Is there a name for this directory format where 'foo.jpg' is in '/img/f/o/'?
by cavac (Prior) on Mar 06, 2023 at 12:21 UTC

    is there a conventional name for this format

    <SCNR>Does "workaround for crappy design where filesystem developers don't put metadata into a proper database" work?</SCNR>

    Honestly, while modern filesystems are astonishingly good at not randomly loosing your data(*), that metadata-in-randomly-located-chained-blocks design just doesn't scale all that well.

    Depending on your operating system as well as file system layout, you could gain a sizeable speed boost by turning off access time logging. On Linux, this would usually be accomplished by adding a "noatime" option in /etc/fstab. This prevent write operations every time you open a directory or file for reading.

    (*) Astonishingly good: Yes. Perfect: No. In modern systems, often enough the culprit of data loss is some random bitflips im RAM.

    PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
Re: Is there a name for this directory format where 'foo.jpg' is in '/img/f/o/'?
by Bod (Parson) on Mar 04, 2023 at 00:29 UTC
    This is hard to google for

    Fortunately, we don't have to only rely on Google now. ChatGPT is pretty good at getting from the thing you find difficult to put into Google to, at least, a good enough search term that is useful for Google.

      I don't know if you're joking, but ChatGPT has proven absolutely terrible at answering factual questions.

        I don't know if you're joking

        No I wasn't joking...

        But equally, I wasn't suggesting that you use ChatGPT to answer the questions. It is great for getting from "I don't know what to put into Google" to having enough idea to get some meaningful search results from Google. It's part of the process, not the complete solution.