:w used to fail if the directory did not exits. See following comment.