Tab#write always overwrites, no need to unlink
Replace files atomically when relocating
Drop intermediate variable
Replace files atomically in inreplace