Revert "fix file unlinking"

This reverts commit 493903b27a03fb4ff7fad764cc6610ba0cb71ce2.