From: "Darryl (gem dandy) Brown" Date: 2010-01-01T09:50:05+09:00 Subject: Re: Path problems On Dec 31, 7:12 pm, Luis Lavena wrote: > On Dec 31, 9:01 pm, "Roger B. Atkins" wrote: > > > Thanks Darryl. > > > The error message: > >  >ruby Test2.rb > >  >The system cannot find the file specified. > > are you invoking ruby in the directory where "Test2.rb" exist? > > Also, is the file named "Test2.rb" and not "test2.rb", things are case > sensitive sometimes. > > -- > Luis Lavena Hello again Roger, Sorry if I threw too much at you.... (__FILE__) is a ruby keyword that holds the dir & file of the program that it's used in. Copy the below snippet into a file and run it for a better feel. $:.unshift File.dirname(__FILE__) unless $:.include? File.dirname(__FILE__) puts "reveal Filename and Dirname attributes \n\n" a = File.dirname(__FILE__) b = File.basename(__FILE__) c = (__FILE__) d = File.dirname $0 e = $0 f = $PROGRAM_NAME puts " a - the current directory => #{a}" puts " b - the current filename => #{b}" puts " c - the current directory and filename => #{c}" puts " d - same output as 'a' only using $0 => #{d}" puts " e - same as 'c' only using $0 => #{e}" puts " f - same as 'c' only using $PROGRAM_NAME => #{f}" Regards, Darryl