async write file