File.delete error

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

On 29 Oct 2007, at 16:30, Rajeev K. 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.

Fred

Frederick C. wrote:

On 29 Oct 2007, at 16:30, Rajeev K. 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.

Fred

Thanks mate. Got it sorted now. Stupid mistake by me i guess.