Hi all... i have folder named test in my application''s public folder . i want to iterate that folder named test which is in public folder. for that i tried this code it gives me error like Errno::ENOENT in Chat logController#chat_log </h1> <pre>No such file or directory - /public/ACMServer_exe/ChatHistory</pre> <p><code>RAILS_ROOT: D:/Projects/inProgress/ANGACM0908/re/Task/acm_administration-31-jan-09</code></p so how should i iterate the folder test which is in public folder Thanks -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Feb 2009, at 10:43, Newb Newb wrote:> > Hi all... > i have folder named test in my application''s public folder . > i want to iterate that folder named test which is in public folder. > for that i tried this code it gives me error like >What code :-) ? Dir.each, Dir.glob, Dir.entries can all be useful for this sort of thing. Fred> > Errno::ENOENT > > in Chat logController#chat_log > > </h1> > <pre>No such file or directory - /public/ACMServer_exe/ChatHistory</ > pre> > > > > <p><code>RAILS_ROOT: > D:/Projects/inProgress/ANGACM0908/re/Task/acm_administration-31- > jan-09</code></p > so how should i iterate the folder test which is in public folder > > > Thanks > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung wrote:> On 3 Feb 2009, at 10:43, Newb Newb wrote: > >> >> Hi all... >> i have folder named test in my application''s public folder . >> i want to iterate that folder named test which is in public folder. >> for that i tried this code it gives me error like >> > What code :-) ? Dir.each, Dir.glob, Dir.entries can all be useful for > this sort of thing. > > FredDir.foreach("/ACMServer_exe") do |folder_name| does this code is correct. but it gives me error. => this folder is in public folder => ACMServer_exe pls help me -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
try this Dir.foreach(RAILS_ROOT + ''/public/javascripts'') do |filename| puts filename end --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---