This was cherrypicking logic from archive/tar, but if would be tedious and not full featured as compared to just extending archive/tar itself