cURL / Mailing Lists / curl-library / Single Mail

curl-library

Something Stpid?

From: Charlie Bursell <charlie.Bursell_at_quovadx.com>
Date: Tue, 19 Jun 2007 12:11:53 -0600

I know I must be doing something stupid here, but I can't figure it out.
In the script below, I get a list of all files in the directory as
expected. Then I try to get the *.txt files in a local variable,
tctFile. If I look at the contents of txtFile after each iteration I
see a directory listing and not the contents of the file. What am I
doing wrong?

 

 

set curlHandle [curl::init]

 

$curlHandle configure -url ftp://10.10.170.62/%2fsomewhere/somedir/ \

    -userpwd mylogin:mypaswd \

    -ftpresponsetimeout 20 \

    -ftplistonly 1 \

    -bodyvar fileList \

    -errorbuffer errMsg

 

$curlHandle perform

 

foreach file $fileList {

            if {[string tolower [file extension $file]] eq ".txt"} {

                        $curlHandle configure -url
ftp://10.10.170.62/%2fsomewhere/somedir/$file \

                                     -userpwd mylogin:mypaswd \

                                     -ftpresponsetimeout 20 \

                                    -bodyvar txtFile \

                        - errorbuffer errMsg

 

                        $curlHandle perform

            }

}

 

$curlHD cleanup

 
Received on 2007-06-19