Hi guys.
I am trying to copy files from one folder to  another.
The code is quite simple:

      frompath = File.join(fromdirectory,filename)
      topath = File.join(todirectory,filename)
      FileUtils.cp(frompath, topath)

The code actually works and indeed copies the images.
The problem is that right after copying them, the REXML throws the
following exception:

REXML::ParseException
 log:
#<RuntimeError: Illegal character '&' in raw string
"���� JFIF    ��;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality =
85
��C                      
                   !         "$" $    ��C                                       
                          ��   � 
\  "      ��                 
 ���             }       !1A  Qa "q 2��� #B�� R��$3br�
     %&'()
*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz���������������������������������������������������
 ..

So., what does REXML have to do with the code?
The actual filename comes from a parsed element. The code previous to
the copy does something like t his.

 doc = REXML::Document.new(screencontent)
    doc.root.each_recursive {|c|
      if c.name == 'File'
        images << c.attributes['source']

After that, I loop through the images array to get and copy all of the
image files.
I must insist that before throwing the exception, the files are
actually copied.

Thanks so much for your help in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to