update writefile