http::geturl in starkit/starpack

From: Jos Decoster (decoster_at_raphael.retarget.com)
Date: 02/16/04


Date: 16 Feb 2004 16:11:20 +0100


Hi,

When wrapping the script below into a starkit or a starpack, the http::geturl
command never completes on Windows (tested on Win2K and XP). Downloading small
files works OK. When downloading large files, the scripts hangs after
downloading several kilobytes. I tested using the latest tclkit runtime from
www.equi4.com (Tcl 8.4.5) and http package 2.4.5.

When running the script without wrapping, it works fine. I tested using the
latest ActiveTcl (8.4.5.0).

Any inputs on how I can solve this problem?

Kind regards,

Jos.

##
## Test script:
##
## http::geturl hangs when using as starkit or starpack
##

package require http

if { $::tcl_platform(platform) == "unix" } {
    set file /tmp/test.tar.gz
} else {
    console show
    set file c:/tmp/test.tar.gz
}

# Use your favorite large binary zip file
set url "http://heanet.dl.sourceforge.net/sourceforge/tcl/tcl8.4.5-src.tar.gz"

proc progress { download_token total_size current_size} {
    puts -nonewline "."
    flush stdout
}

proc complete { download_token } {
    puts " END"
    flush stdout
}

set f [open $file w]
fconfigure $f -encoding binary

set download_token [http::geturl $url -binary true -channel $f \
                        -progress progress -command complete]

puts "Waiting for download to complete..."

http::wait $download_token

puts "Waiting done!!!!!"

# Check errors if I get here

http::cleanup $download_token

close $f



Relevant Pages

  • reliability problem with Finance::QuoteHist::Yahoo
    ... I have been able to get this package to work sometimes. ... downloading data for from one to four ticker symbols. ... The script I am using is appended below. ... foreach $row ) { ...
    (comp.lang.perl.misc)
  • Re: reliability problem with Finance::QuoteHist::Yahoo
    ... downloading data for from one to four ticker symbols. ... The script I am using is appended below. ... I have historical quote data ...
    (comp.lang.perl.misc)
  • Re: png javascript problem
    ... It does not occur the first time, ... Did I something wrong or is there a script to stop the downloading? ... display: block; ...
    (comp.lang.javascript)
  • Re: png javascript problem
    ... It does not occur the first time, ... Did I something wrong or is there a script to stop the downloading? ... display: block; ...
    (comp.lang.javascript)
  • Re: starpack & starkit source tcl files
    ... > Am trying to create a starpack on linux-x86 but can't seem to get the ... > package require starkit ... [info script]]" - although that too is not full proof when called from ...
    (comp.lang.tcl)