in reply to BigDemon

you are not handling errors on open calls ..