I must have misunderstood the question, then. Original poster wanted to remove all extensions from a file, not just the last one, i.e. from file.tar.gz to file. Whereas calling .stem only removes .gz in this case. So would you not want to strip the last 7 characters, so that file.tar.gz turns to file?