test file writing