changed path decomposition to handle multi-extensions like .tar.gz