From: Andrew Timberlake Date: 2008-01-08T20:53:13+09:00 Subject: Re: creating directory and zipping it Raju By overwrite the directory, I assume you want to delete the contents of the directory if it exists, you can do that as follows: if File.exists?('test') && File.directory?('test') Dir['test/**/*'].reverse.each { |path| if File.file?(path) then File.delete(path) else Dir.rmdir(path) end } else Dir.mkdir('test') end Andrew Timberlake andrew@andrewtimberlake.com 082 415 8283 skype: andrewtimberlake "I have never let my schooling interfere with my education." --Mark Twain -----Original Message----- From: list-bounce@example.com [mailto:list-bounce@example.com] On Behalf Of Raju Aralikatti Sent: 08 January 2008 11:51 AM To: ruby-talk ML Subject: Re: creating directory and zipping it and also Andrew I want to overwrite the directory if the newly created directory has the same name of the existing directory. -- Posted via http://www.ruby-forum.com/. !DSPAM:3,4783489239791012915643!