This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
FAIN
Voice
Posts: 1 Joined: Fri Aug 29, 2003 8:25 pm
Post
by FAIN » Fri Dec 31, 2004 11:19 am
I'm trying to write a script for my eggdrop bot to parse a textfile that is compressed with gzip but can't get it to work.
I'm currently using the http package with the following code:
Code: Select all
set page [::http::geturl ${temp_URL}]
set lines [split [::http::data ${page}] \n]
set numLines [llength ${lines}]
Then I just parse it a line by a line with a for loop but the problem is that I just get junk from it since it's compressed. I've looked at the compress module some but not quite sure how to use it in this case.
Any help would be appreciated!
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Fri Dec 31, 2004 3:24 pm
What are you trying to do? You first must download the file, unpack then view it. This should save the file:
Code: Select all
package require http
set f [open "some.file.tgz" w]
::http::geturl "http://somepage/some.file.tgz" -channel $f
close $f
if that's what you are looking for.
Once the game is over, the king and the pawn go back in the same box.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Fri Dec 31, 2004 3:43 pm
you need the
mkZiplib extension, which will allow you to decompress your data on-the-fly