Q:

Learn to Program Ruby Chapter 11.7

I'm doing Chris Pine's Learn to Program 2nd Ed book for ruby. I can't seem to replicate his Ch 11.7 example. Would really appreciate any input. Thanks! For some reason when I run this program, it will puts the following:
What do you want to call the root name for these files?
testtext
Downloading 0 files:
Done!
The files don't move. Also, the folder structure is as follows
+-- _6write
|   +-- copyfiles
|   |   +-- New Text Document.txt
|   |   +-- New Text Document - Copy.txt
|   |   +-- New Text Document - Copy (2).txt
|   +-- pastefiles

Below is the code:
#Ch 11.7 Example

Dir.chdir 'C:\Users\user\Desktop\RoR\Ruby Projects\_6write\pastefiles' 
pic_names = Dir['C:\Users\user\Desktop\RoR\Ruby 
Projects\_6write\copyfiles\*.{txt, TXT}']

puts "What do you want to call the root name for these files?" batch_name = 
gets.chomp puts print "Downloading #{pic_names.length} files: "

pic_number = 1

pic_names.each do |name|   print '.'

  new_name = if pic_number <10
    "batch_name#{pic_number}.jpg"   else
    "batch_name#{pic_number}.jpg"   end   File.rename name, new_name

  pic_number = pic_number + 1 end

puts

puts "Done!"

A:

Instead of
Dir.chdir 'C:\Users\user\Desktop\RoR\Ruby Projects_6write\pastefiles' 
pic_names = Dir['C:\Users\user\Desktop\RoR\Ruby'] 
it has to be 
Dir.chdir 'C:/Users/dlma1/Desktop/RoR/Ruby Projects/_6write/pastefiles'
pic_names = Dir['C:/Users/dlma1/Desktop/RoR/Ruby Projects/_6write/copyfiles/*.{txt,TXT}']
So / must be used instead of \ when using Dir in the yaml module.

