Hey guys,

I am trying to rename a list of files, pictures to be exact, so that
they don't show up as some random/unknown name.

I am getting an error

===================

./rename.rb:20:in `rename': File name too long -
...rename.rbunknown-1.jpgunknown-10.jpgunknown-11.jpgunknown-12.jpgunknown-13.jpgunknown-14.jpgunknown-15.jpgunknown-16.jpgunknown-17.jpgunknown-18.jpgunknown-19.jpgunknown-2.jpgunknown-20.jpgunknown-21.jpgunknown-22.jpgunknown-23.jpgunknown-24.jpgunknown-25.jpgunknown-26.jpgunknown-27.jpgunknown-28.jpgunknown-29.jpgunknown-3.jpgunknown-30.jpgunknown-31.jpgunknown-32.jpgunknown-33.jpgunknown-34.jpgunknown-35.jpgunknown-36.jpgunknown-37.jpgunknown-38.jpgunknown-39.jpgunknown-4.jpgunknown-40.jpgunknown-41.jpgunknown-42.jpgunknown-43.jpgunknown-44.jpgunknown-45.jpgunknown-46.jpgunknown-47.jpgunknown-48.jpgunknown-49.jpgunknown-5.jpgunknown-50.jpgunknown-51.jpgunknown-52.jpgunknown-53.jpgunknown-54.jpgunknown-6.jpgunknown-7.jpgunknown-8.jpgunknown-9.jpgunknown.jpg
or Amber 0.jpg (Errno::ENAMETOOLONG) from ./rename.rb:20 from
./rename.rb:14
===================
when I try to run my script but I can't seem to figure out the error.

>From what I can see , its turning my list of names into one long string
the its telling me the file name is to long. Based on what I read in
the Ruby Doc website (http://www.ruby-doc.org/) specifically on
File.rename (http://www.ruby-doc.org/core/classes/File.html#M002591)

It tells me the syntax I should use is
===================

File.rename(old_name, new_name)
example: File.rename("afile", "afile.bak")

===================
The code I used to write this is as follows:

===================

test = []

Dir.chdir("/Users/lem/pictures/")

test[test.length] = Dir.entries("Amber Copy")

test.to_s.each do |pics|
 counter = 0
 File.rename(pics , "Amber " + counter.to_s + ".jpg")
  counter = counter + 1
end

puts "Done!"

===================

I have a feeling its something simple but I just can't seem to grasp
what it is, can anyone drop me a hint?