From: Yohanes Santoso Date: 2002-04-04T20:51:35+09:00 Subject: Re: Test the result of an initialization ? jayce@mosx.net (Jayce Piel) writes: > What I want is if the path is not a path to a file, the object is not > created. I try to do a "return nil" in initialize, but it has no effect. class ArchiveFile def initialize(filename) if not File.stat(filename).file? raise "#{filename} is not a valid file" end end end The return of #initialize is ignored. #initialize is called by #new, and #new returns only the created object, not the return from #initialize. BTW, there are already packages that handle tar and zip files. YS.