always copy through a temporary file