From: Graham Nicholls Date: 2004-07-02T20:12:51+09:00 Subject: Exceptions list - Unix ENOENT not the name of the exception - what is? Hi, I'm trying to open a file, and if the user hasn't given an extension, adding one, but I can't find out what exception to use. If I leave off the rescue statements, then I see ENOENT, so try using that, but get a NameError - ENOENT is the Unix error, not Ruby's. So, what is the exception for a missing file on IO.foreach, and how in general can I get a list of exceptions or find out which is the right one to use? eg: if $include_header orig_hdr_fname=header_fname begin IO.foreach(header_fname) do |hdr_line| # Allow comments in header files: opfile.write(hdr_line) if hdr_line !~ /^\s*#/ end rescue IOError <---- THIS IS THE PROBLEM header_fname=header_fname+"frt" printf("Error reading header file %s - trying %s\n",orig_hdr_fname,header_fname) retry rescue => err printf("Error opening header file %s\n",err) exit(BAD_FILE) end Thanks -- Graham Nicholls With Linux, the answer's always "Yes"