Obviously, pathExtension works as expected in this case. The documentation for pathExtension states:
A path extension is part of the last component of a path that follows the last period, if any.
I see where you came from with your tarred gzipped example. However, I would say .gz is an extension. Unpacking the file (using gzip ) will create a .tar file that can be extracted using tar .
I assume that the file naming convention with the extension .tar.gz started before tar could also do gzip compression. The gzip application adds .gz to the file name of the compressed file. For example, the gzipping log file, access.log , will result in a file called access.log.gz .
The .tgz extension was used for tarred gzipped files, especially in cases where the file name needs to be saved on file systems that will prevent the extension (for example, DOS).
mttrb source share