How to use the safe_unlink method?

All-

I’m trying to write a progam that will delete all files in a directory.

Here’s a test program using safe_unlink with which I’m trying to delete all files in the immediate subdirectory (output) to the program:

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

When I run this program, nothing happens, not even an error. No files are delete anywhere.

In an earlier question about deleting files, a couple of you wrote a several-line procedure without mentioning the safe_unlink method. I since read a bit about this method, so I thought I’d ask about it directly.

Thanks a bunch!

   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