On 2021-01-10 at 05:03:08 +1100, Chris Angelico firstname.lastname@example.org wrote:
On Sun, Jan 10, 2021 at 4:51 AM Stephen J. Turnbull email@example.com wrote:
Joseph Martinot-Lagarde writes:
One remark about this : .tar.gz files are the exception rather than the rule, and AFAIK maybe the only one ?
Not really. stem.ext -> stem.ext.zzz where zzz is a compression extension is a pretty common naming convention. For me ext == 'tar' is by far the most common case (74%), 'tis true, but 'patch' (10%), 'txt' (6%), 'tab', 'gml', 'xml', 'svg', 'pdf', 'ps', ' dvi', 'diff', 'pdb', 'cpp', 'el', and 'data' also exist somewhere under $HOME. I'll bet others show up if I search /usr, /var, and /opt.
Yep, and most of my man pages are compressed, so there's usr/share/man/man1/*.1.gz and friends.
I'd say the most common case with multiple extensions is indeed precisely two, where the first one is the type of file (or in the case of man pages, the section), and the second is a compression format. But there'll be less common cases too.
I also have a pile of whatever-x.y.z.* files, where the * is some kind of compression extension and x.y.z is a major.minor.patch identifier.
Most of the time, my brain is big enough to spot where x.y.z ends and the extension(s) begin(s), but throw in a version identifier like 4.3.beta, and all bets are off (unless I happen to know exactly what to look for, in which case I wouldn't bother with a general purpose library function that might make the wrong assumption).