Connecting Tech Pros Worldwide Forums | Help | Site Map

Reading files/folders and creating a zip file

Newbie
 
Join Date: Jun 2008
Posts: 4
#1: Jun 13 '08
Hi,

I am using RubyZip and want to read a folder and keep all the sub folders and files and create a .zip file.

Please give me ant sample code on the same.

I tried to read a file like this

file3=open("Ruby/Samples","r")
puts file

Throws permission denied error.

Thanks
User

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jun 26 '08

re: Reading files/folders and creating a zip file


Look into the Dir class.
Reply