
On Thu, Apr 7, 2011 at 10:23, Olaf van der Spek <olafvdspek@gmail.com> wrote:
Hmm, I was thinking about stuff like file.tar.gz
That works for the easy case, but then you get files like this: http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.27.14.tar.bz2 Splitting that as "linux-2" and ".6.27.14.tar.bz2" is really not helpful. Since the only way to handle things like that is a loop, it's more convenient to take extensions off the end, getting ".bz2" then ".tar" by looping the extensions of the stems. Actually, looking at that loop is interesting for this thread, since doing it the other way around would require Beman's proposed change. If you wanted to get "linux-2" then ".6" then ".27" etc by looping the stems of the extensions, then it would have to work by "the extension starts from the first dot that's not the first character in the string"... ~ Scott