From: Andrew Timberlake Date: 2008-01-08T16:20:26+09:00 Subject: Re: creating directory and zipping it Raju 1. Create a directory d = Dir.mkdir('test') #creates a directory named 'test' 2. Create a file File.open('test/test.txt', 'w') { |f| puts 'Hello World' } #creates a new file named test.txt inside the directory 'test' and writes 'Hello World' into the file 3. This is done in the above code by creating the new file inside the directory itself 4. Zip the directory %x{zip -r test.zip test} #This executes the zip command of the underlying operating system (I'm using Linux) and creates a zip file named test.zip containing the directory 'test' (the -r flag makes the zipping recursive) #If you can't use that (on Windows), try rubyzip.sourceforge.net/ - I have not used it but I found it via Google search Hope that helps Regards 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 08:42 AM To: ruby-talk ML Subject: Re: creating directory and zipping it Matt Todd wrote: > http://rake.rubyforge.org/svn/trunk/lib/rake/packagetask.rb > > Has some code for packing things up. > > Matt hi Matt, I m new to ruby, can you tell me how to 1. create directory using ruby. 2. Then create a file. 3. Put the newly created file in the new directory. 4. zip the directory. -- Posted via http://www.ruby-forum.com/. !DSPAM:3,47831c5e223171609211822!