code: def remove_entry(self, pathname_name, recursive=True):
          
          pathname_name = self._normalized_entryname(pathname_name)
          entry = self.get_entry(pathname_name)
          if self.filesystem.is_windows_fs:
              if entry.st_mode & PERM_WRITE == 0:
                  self.filesystem.raise_os_error(errno.EACCES, pathname_name)
              if self.filesystem.has_open_file(entry):
                  self.filesystem.raise_os_error(errno.EACCES, pathname_name)
          else:
              if (not is_root() and (self.st_mode & (PERM_WRITE | PERM_EXE) !=
                                     PERM_WRITE | PERM_EXE)):
                  self.filesystem.raise_os_error(errno.EACCES, pathname_name)
  
          if recursive and isinstance(entry, FakeDirectory):
              while entry.contents:
                  entry.remove_entry(list(entry.contents)[0])
          elif entry.st_nlink == 1:
              self.filesystem.change_disk_usage(
                  -entry.size, pathname_name, entry.st_dev)
  
          self.st_nlink -= 1
          entry.st_nlink -= 1
          assert entry.st_nlink >= 0
  
          del self.contents[pathname_name]
docs: Removes the specified child file or directory.
  
          Args:
              pathname_name: Basename of the child object to remove.
              recursive: If True (default), the entries in contained directories
                  are deleted first. Used to propagate removal errors
                  (e.g. permission problems) from contained entries.
  
          Raises:
              KeyError: if no child exists by the specified name.
              OSError: if user lacks permission to delete the file,
                  or (Windows only) the file is open.