on a busy (darwin) system it's leaving done files around, this is more atomic
use a unique temporary name to avoid conflicts