From: Power One Date: 2009-03-08T18:36:33+09:00 Subject: Re: I code my first ruby script, and it got problem! Heesob Park wrote: > Hi, > > 2009/3/8 Power One : >> creating directory "land", the script creates a directory "land?".  How >> can I solve this problem?  You can see my script at >> http://pastie.org/410753. > You actually created directory not "land?" but "land\n" > > The line # 5 of your code > if @dirname = gets > should be > if @dirname = gets.chomp > > > Regards, > > Park Heesob Thanks Park Heesob, gets.chomp did the job perfectly, but my very last code is like @letst.del_dir which is calling the "def del_dir" is not working. I think Dir.delete is the wrong way to use for deleting a directory? def del_dir if File.exist?("#{@dirname}") puts "I'm going to delete your directory #{@dirname}" Dir.delete("#{@dirname}") puts "#{@dirname} has been deleted." else puts "#{@dirname} is still here!" end end -- Posted via http://www.ruby-forum.com/.