How to use the safe_unlink method?

Guy-

Thanks, but a follow-up question:

How exactly would I rewrite my file (which happens to be named “dl.rb”) which currently includes just this text:

require 'ftools’
File.safe_unlink(".\output*.*")

Do you think this code should be correct as written? (I don’t understand your “ruby -rftools -e” text.)

NOTE: In case it makes a difference, I’m using ruby on an NT machine.

Thanks!

-Kurt

···

-----Original Message-----
From: ts [mailto:decoux@moulon.inra.fr]
Sent: Wednesday, August 14, 2002 12:59 AM
To: ruby-talk@ruby-lang.org
Cc: ruby-talk@ruby-lang.org
Subject: Re: How to use the safe_unlink method?

File.safe_unlink(".\output*.*")

Well, it work fine

pigeon% ls -d .*
./ …/ .output*.*
pigeon%

pigeon% ruby -rftools -e 'File.safe_unlink(".\output*.*")'
pigeon%

pigeon% ls -d .*
./ …/
pigeon%

safe_unlink don’t accept meta-characters like *

Guy Decoux