Hey, I''m trying to delete a file using: File.delete(RAILS_ROOT, "public/images/logo.jpg") But I get an error saying: Errno::EISDIR in MainController#cancel Is a directory -. Is there another way to delete a file? Cheers -- 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 29 Oct 2007, at 16:30, Rajeev Kala wrote:> > Hey, > > I''m trying to delete a file using: > > File.delete(RAILS_ROOT, "public/images/logo.jpg") > > But I get an error saying: > > Errno::EISDIR in MainController#cancel > > Is a directory -. > > Is there another way to delete a file? >File.delete tries deletes each of the files specified, so you''re telling it to delete RAILS_ROOT, to which it quite correctly replies that RAILS_ROOT is a directory. Fred --~--~---------~--~----~------------~-------~--~----~ 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 29 Oct 2007, at 16:30, Rajeev Kala wrote: > >> >> Is a directory -. >> >> Is there another way to delete a file? >> > File.delete tries deletes each of the files specified, so you''re > telling it to delete RAILS_ROOT, to which it quite correctly replies > that RAILS_ROOT is a directory. > > FredThanks mate. Got it sorted now. Stupid mistake by me i guess. -- 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 -~----------~----~----~----~------~----~------~--~---