From: Cheyne Li Date: 2008-05-13T07:29:12+09:00 Subject: Re: Problem with files comparing Dave Thomas wrote: > On May 12, 2008, at 4:58 PM, Cheyne Li wrote: >> >> After running the function. There's no result as all. Is there anybody >> has the idea what's wrong with it? > > > You probably need to call your function. > > > Dave Hi, Dave I tried put them in a class, and tested, but it kept throwing me the error message. The code and error message are in the following: class Cmprocess # Create the object def initialize(from,to) @from = from @to = to end def fcmp require 'ftools' compare(@from,@to, true) end r= Cmprocess.new("my_log.txt","my_log_e.txt") if r.fcmp then puts "Identical files." else puts "Different files." end end C:\Documents and Settings\cheynel\My Documents\NetBeansProjects\task1\lib\fcmp.rb:11:in `fcmp': undefined method `compare' for # (NoMethodError) from C:\Documents and Settings\cheynel\My Documents\NetBeansProjects\task1\lib\fcmp.rb:16 from C:\Documents and Settings\cheynel\My Documents\NetBeansProjects\task1\lib\fcmp.rb:2 I used netbean for ruby to ran it -- Posted via http://www.ruby-forum.com/.