I found the error. It was actually my mistake. Later in the code for
whatever reason I was actually opening and trying to parse an image
file with REXML, so it was breaking there, not in the previous part.

Thank you so much for your useful replys.


On Jul 22, 5:51 pm, sami <[email protected]> wrote:
> We had faced same type of problem while working onwww.scrumpad.com,
> next generation scrum project management tool. In that case we have
> installed a gemrexmlfix. that had saved us from this problem you
> can check that one.
>
> basicallyrexmlis used for parsing
> On Jul 22, 3:39 pm, Javier Quevedo <[email protected]> wrote:
>
>
>
> > 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, theREXMLthrows 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 doesREXMLhave 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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to