Hi, Robert

-----Original Message-----
From: Robert Klemme [mailto:shortcutter / googlemail.com] 
Sent: Monday, May 14, 2007 12:20 PM
To: ruby-talk ML
Subject: Re: slow file access with mapped drives ?!

/*
Why don't you just do

Dir.glob("//servername/c$/targetdir/**/"<<config['targetfilepattern']).e
ach 
do |file|
*/

Because i need to have the targetdirs flexible, for example i have in
my yaml =

targetdirs:
- Y:/tempwork
- T:/rubytest
- //wvp10175/c$/SCM_Server

/*
Btw, I don't see any reference to block variable "dir" is this on
purpose?
*/

config['targetdirs'].each do |dir|
    Dir.chdir(dir)
    Dir.glob("**/"<<config['targetfilepattern']).each do |file
...
end
...end


> any alternatives to Dir.glob ?

/*
Find.find - but don't expect that it's faster because the slowness lies 
in file system accesses.  Network drives are inherently slower than 
local disks.
*/

it runs in almost half the time, much quicker :-)
thanks for the pointer !! , now i have =

config['targetdirs'].each do |dir|
    Find.find(dir) do |f|
      if f =~ /#{config['targetfilepattern']}/
      puts "... processing "<<f
      filesed!(config['replacefrom'],s,f)
      end
    end
  end

Best regards, Gilbert