test writing testfile in a nonexistent directory