From: Amit Tomar Date: 2010-10-07T15:59:45+09:00 Subject: how do i close a file that is open in ruby Hi all, i would like to close a file that is open in particular directory .this is my code require 'fileutils' dir ="C:/Documents and Settings/x0138466/Local Settings/Temp" Dir.chdir(dir) Dir["*"].each do |f| f.close # File.close FileUtils.rm_rf(f) #FileUtils.rm(f) end Some of the file in TEMP folder is open or you can say used by some process but i want to close but with above code am not ablr to do that??is it possible to achive from above code?? -- Posted via http://www.ruby-forum.com/.