From: James Herdman Date: 2009-04-08T23:37:18+09:00 Subject: Re: Copying Windows system files --001636163e5b649c1304670c11cd Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Stuart. Two thoughts: 1) Maybe you don't have access to the file? 2) Instead of opening the file, reading it, and then copying it else where, why not look into using FileUtils.cp? It would be a little more direct. It also may end up being the key if you do, in fact, have access to the file. James On Wed, Apr 8, 2009 at 10:15 AM, Stuart Clarke wrote: > Hi all, > > Does anyone know how to copy Windows system files? I have a script which > looks for certain files and writes a log with the path of the file found > and copies the file found to a folder. > > This works fine for all files I am interested in except the index.dat > file. My script finds the file and writes it to a log but doesn't > actually copy the file. Does any one know how I can copy an index.dat > file? The relevant code: > > def copyFile(file) > myLog = File.new('\\Test\\SweeperLog.txt', 'a') > myLog.puts file > File.copy(file, '\\Test') > end > > Many thanks > -- > Posted via http://www.ruby-forum.com/. > > --001636163e5b649c1304670c11cd--