foo.tar.gz would you expect it to return
foo. I’d expect
foo but the documentation isn’t clear.
foo.tar would make more sense because what would you do for
The other advantage is you can call it multiple times, each time processing one layer, as in the given example gzip would extract the tar and tar would then extract the files (I am aware that the commandline tar can do it in one go).