[Rails] Re: strings issue
thelo.g thelo wrote in post #1018716:
> Hi everybody,
>
> I ve got a problem with strings and the class File in rails
> Indeed, when i try to do this:
> File.new("archives/sequences/archives-2011.xml")
> it works perfectly, however when i do
> string = "archives/sequences/" + @filename => filename being
> "archives-2011.xml"
> File.new(string)
>
> it doesn't work!
> ruby tells me it cannot find the file
You lie:
str1 = 'archives/sequences/archives-2011.xml'
@filename = 'archives-2011.xml'
str2 = "archives/sequences/" + @filename
puts str1 == str1
--output:--
true
--
Posted via http://www.ruby-forum.com/.
--
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+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home