test write file