From: ts Date: 2002-11-08T02:04:05+09:00 Subject: Re: question about FILE::delete >>>>> "D" == Daniel Schnell writes: D> pattern = "c:/WinNt/*" D> num = File.delete(pattern) File::delete don't take a pattern but just a filename pigeon% ls a b c pigeon% pigeon% ruby -e 'File.delete("*")' -e:1:in `delete': No such file or directory - "*" (Errno::ENOENT) from -e:1 pigeon% Now to catch the error pigeon% ruby -e 'File.delete("*") rescue p "ERROR #$!"' "ERROR No such file or directory - \"*\"" pigeon% and if you want to delete all files pigeon% ruby -e 'Dir["*"].each {|f| File.delete(f) }' pigeon% pigeon% ls pigeon% Just protect File::delete in the block {} if you want catch the error Guy Decoux