From: unbewusst.sein@... (=?ISO-8859-1?Q?Une_B=E9v?= =?ISO-8859-1?Q?ue?=) Date: 2007-04-05T22:10:09+09:00 Subject: Dir.glob time of evaluation if i do : Dir.glob(".*xhtml"){|f| fo=f.gsub(/(.*)\.xhtml$/,'\1_orig.xhtml') if `mv "#{f}" "#{fo}"` File.open("#{f}",'w').puts # c is true when we want to clean up orig files `rm -f "#{fo}"` if c end } i got an error like : /Users/yt/bin/set_xhtml_date:58:in `ftype': No such file or directory - /Users/yt/Sites/Events/event_listener_orig.xhtml (Errno::ENOENT) i think this is because Dir.glob "sees" the saved file fo (/Users/yt/Sites/Events/event_listener_orig.xhtml in this case) before it has been removed with "`rm -f "#{fo}"`" then i changed my script to : fl=Dir.glob(".*xhtml") fl.each{} then, because fl is evaluated before any added *_orig.xhtml file i don't get anymore this error... am i right or dreaming ???? -- Une B�vue