From: "Peña, Botp" Date: 2008-10-30T10:34:07+09:00 Subject: Re: Question concerning ruby file access From: Stefan Salewski [mailto:mail@ssalewski.de] # Or in other words: I want to print a text like "File # with filename "testfile" does not exist" when opening failed. i usually think it like db's logical unit of work or transaction. i just wrap it w ruby's begin/end and a rescue check as mentioned by sebastian. something like eg > begin * File.open("test.rbx") do |f| * end > rescue =>e > p e.message > end "No such file or directory - test.rbx" => nil note, you can have more rescues and finetune them. you can also make your own exceptions.. just continue reading on the pickaxe..