Oddbean new post about | logout
 @e7491467 @2ad00f7c 

Also, I fucked up. For this specific use-case it should be 

for name in names:
  Path(name).unlink(missingok=True)

If there isn't, it should be in a try-except just for correctness. Without it there is a very theoretical (given your use-case) race condition. 
 @87c98d39 @e7491467 @2ad00f7c Um.

Going back to the *problem*, untarring in the wrong directory, neither code is necessarily good.

1. Where you did this, there is an entry "foo".
2. The tarball contains an entry "foo".

If you overwrote "foo", your original file is lost. If you didn't, you'll lose it after deleting all entries contained in the tarball. 
 @70281677 @e7491467 @2ad00f7c 

Yeah, the actual solution is to ask time machine stat.