Complete the rmdir function.