rtrim, check that not end of file put in most functions