don't hardcode /tmp, fix Windows doctests
read full file before deleting it.