From: Hugh Sasse Date: 2005-11-01T03:15:54+09:00 Subject: Trapping errors. begin #... rescue => e #... end will trap e if it is a StandardError. SystemCallErrrors are supposed to handle Errorcodes from the OS. All of these are subclasses of Exception. So why do I get this failure under Cygwin: $ ruby BACKUP.RB "C:\\" "D:\\buzz_c" cp -rp C:\ D:\buzz_c /usr/lib/ruby/1.8/new_fileutils.rb:1251:in `initialize': Device or resource busy - C:\/WINDOWS/WIN386.SWP (Errno::EBUSY) from /usr/lib/ruby/1.8/new_fileutils.rb:1251:in `copy_file' from /usr/lib/ruby/1.8/new_fileutils.rb:1221:in `copy' from /usr/lib/ruby/1.8/new_fileutils.rb:455:in `copy_entry' from /usr/lib/ruby/1.8/new_fileutils.rb:1314:in `traverse' from /usr/lib/ruby/1.8/new_fileutils.rb:453:in `copy_entry' from /usr/lib/ruby/1.8/new_fileutils.rb:424:in `cp_r' from /usr/lib/ruby/1.8/new_fileutils.rb:1385:in `fu_each_src_dest' from /usr/lib/ruby/1.8/new_fileutils.rb:1401:in `fu_each_src_dest0' from /usr/lib/ruby/1.8/new_fileutils.rb:1383:in `fu_each_src_dest' from /usr/lib/ruby/1.8/new_fileutils.rb:422:in `cp_r' from BACKUP.RB:27 hgs@buzz ~/downloads when my modified FileUtils.cp_r has begin copy_entry ... rescue Exception => e logger.error("backup"){"Error was #{e}") end (essentially. Theres a bit more to it than that, but the details shouldn't matter for my question.) So why can't I rescue it? (I'm trying to log, and skip files I can't backup so at least I get most of the files, and know which ones I have not.) Anyone also reading ruby-core will realize that my patch didn't work in practice. Thank you, Hugh