read until EOF or other error