writefile begin