On Jan 8, 7:33 am, Raju Aralikatti <[EMAIL PROTECTED]>
wrote:
> hi,
> can anyone help me.
>
> I want to create a folder, create another file of .url type and save the
> .url file in the folder and zip the folder. I am sending the code which
> I have written.
>
> dir_name = Dir.new("InstitutionShortcut")
This will NOT create a directory. use dir.mkdir(...) for that.
> file_path =
> "#{RAILS_ROOT}/public/test/#{dir_name}/[EMAIL PROTECTED]"
> f = File.new(file_path, "w")
> content = ""
> content += "[InternetShortcut]\n"
> content += "URL=http://192.168.1.233:5555/index.jsp?"
> content += "passcode="[EMAIL PROTECTED]"\n"
> content += "IconFile=http://192.168.1.233:5555/favicon.ico\n"
> content += "IconIndex=1\n"
> content += "Modified=30B027EB835EC40198"
> f.write( content )
> f.close
> dir_name.zip
This will NOT zip your dir :). .zip is Enumerable method:
http://ruby-doc.org/core/classes/Enumerable.html#M003169
To make zip archives check the 'rubyzip' gem.
>
> can anyone help me
>
> Thanks in advance
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Deploying Rails" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-deployment?hl=en
-~----------~----~----~----~------~----~------~--~---