You can still use `read`, you just need to print a prompt first. In `zsh`, `-p` indicates that input should be read from a coprocess instead of indicating the prompt to use.
You can do the following instead, which is POSIX-compliant:
printf >&2 '%s ' 'erase all directories? (y/n)'
read ans
Like for ksh/zsh's `read 'var?prompt'` or bash's `read -p prompt var`, the prompt is issued on stderr so as not to pollute the normal output of your script.