A stout cane of dense wood or practically anything that can be used as a club is a better defensive weapon than a knife.
If you swing with authority and they manage to block then you'll have likely disabled one of their arms. The pain of being struck with a heavy object is much greater than a more serious wound with a knife.
Connect with the skull and they will be dazed, while a slash to the face may hurt and frighten, a cracked skull is far more likely to disable.
A cane gives much greater reach than a knife and while you can block or divert a knife thrust with a cane, you aren't likely to divert a thrust or blow from a cane with a knife.
I used to own a sword cane, but since this was as much a deadly weapon as a pistol would be, and probably illegal almost everywhere in the U. S., I gave it away.
They used to sell a very neat small folding hatchet that would fit in a back pocket. I always wanted one of those.
I have a folding pocket saw that opens with a flick of the wrist and locks securely, that would make some guesome and extremely painful slashing wounds.