M
Mark Probert
Hi ..
In one of my apps, I am doing something like
def clean
f = `rm -f #{@datadir}/*.raw`
end
I could, just as easily do
def clean
Dir["#{@datadir}/*.raw"].each do |f| File.delete(f) end
end
Besides the portability aspect (does 'rm' exist on the box?), is one to be
preferred to the other?
Regards,
In one of my apps, I am doing something like
def clean
f = `rm -f #{@datadir}/*.raw`
end
I could, just as easily do
def clean
Dir["#{@datadir}/*.raw"].each do |f| File.delete(f) end
end
Besides the portability aspect (does 'rm' exist on the box?), is one to be
preferred to the other?
Regards,