From: ts Date: 2002-07-27T21:53:16+09:00 Subject: Re: copying >>>>> "B" == Benjamin Sommerfeld writes: B> in ftools.rb is a method copy(sourcefile,destfile) pigeon% ls [bc].rb b.rb* pigeon% pigeon% cat b.rb #!/usr/bin/ruby require 'ftools' File::copy 'b.rb', 'c.rb' pigeon% pigeon% b.rb pigeon% pigeon% ls [bc].rb b.rb* c.rb* pigeon% pigeon% head -12 lib/ftools.rb class << File TOO_BIG = 1024 * 1024 * 2 # 2MB def catname from, to if FileTest.directory? to File.join to.sub(%r([/\\]$), ''), basename(from) else to end end pigeon% 'class << File' means that ruby will define methods in the singleton class (i.e. a class method). This is why `self' must be the name of the class when you call ::copy Guy Decoux