From: Ronald Fischer Date: 2007-06-05T00:26:52+09:00 Subject: Re: Deleting a file - is there a less clumsy way to do this? > > Basically, I am doing something like this: > > > > if File.exist?(filename) > > File.unlink(filename) > > end > > > > You can get it down to one line by doing this: > > File.delete(filename) if File.exist?(filename) > > > That doesn't look so bad. :-) Well, I'm not so much concerned about the *lines* of code, but of the complexity, in particular since this variation requires to name "filename" twice. (side note: why does this remind me to the ongoing thread "Introducing the "it" keyword"..... ;-) In Perl for instance, I would simply write unlink filename; and implicitly void the result... Ronald