only readline if file exists