On Tue, Sep 13, 2005 at 07:52:00AM -0700, Scott Laplante wrote:
> Subject: tcllib configure/install (ftp client)

> Does anyone have any experience using
> tcllib1.7(http://tcllib.sourceforge.net/) with AOLServer3.4 (yeah, yeah, i
> know)?  we're having problems getting aolserver to recognize the package.

Why are you still be using AOLServer 3.4?  It's ancient.

I haven't used Tcllib in AOLserver myself, but I know some of the
OpenACS people have - with AOLserver 4.  Also, 'package require' and
therefore also Tcllib are known to work much better in AOLserver 4.0.x
than in 3.x.  So you will probably have more success if you first
upgrade to AOLserver 4.

> Specifically, we're trying to ftp files from our server to an existing ftp
> server.  if there's a simpler way to do that outside of the tcllib release,
> i'm all for it.

Long ago, with AOLserver 3, I used ncftpput.  This is really easy,
e.g.:

   if { [catch { 
      set result [exec ncftpput -u $user -p $password -m $host $remote_dir 
$local_file] 
   } err] } { 
      set result $err 
      # Kludgy, but eval'ing code with an exec can be annoying: 
      set failed_cmd "exec ncftpput -u $user -p $password -m $host $remote_dir 
$local_file" 
      ns_log Error "$proc_name:  Command:\n   ${failed_cmd}\nfailed with 
error:\n   ${err}" 
   } 

There is of course also an ncftpget command for fetching files.  Note
though that these ncftp* commands are one shots - which is both their
advantage and their limitation.  If you need to browse around the ftp
server, find what files are there, fetch the ones you want, etc., they
aren't good enough, you need something with more of an API.

>From tclsh, I've done 'package require ftp' (which is part of Tcllib I
think) and then used the various ::ftp::* commands programmatically.
Of the methods I've tried, this is by far the nicest and most powerful
way to do ftp from Tcl.  (It let me use ::ftp::ModTime to check the
modification times of remote files, etc.)

I never tried the Tcllib ftp from AOLserver, but that was only by
happenstance.  I certainly would try it first if I wanted to ftp from
AOLserver 4.x.  And of course, if for some reason direct use from
AOLserver fails, you could always just exec a tclsh script from
AOLserver.  Unfortunately, I don't think Tcllib supports sftp, or any
form of secure file transfer at all.

I've launched an Expect script from AOLserver in order to drive sftp
for fetching files securely and privately.  (scp would often be a
better choice, but sometimes the remote server supports sftp but not
scp.)  That wasn't too bad, and worked fine.

I played once with libcurl and TclCurl, which support almost every
method under the sun there is for transferring files.  It sounds like
definitely the way to go for fast multi-protocol file transfer
support:

  http://curl.haxx.se/libcurl/tcl/
  http://personal1.iddeo.es/andresgarci/tclcurl/english/index.html

Finally, occasionally you might need to fetch or send stuff via an SSL
https connection AFTER logging into a website and setting cookies
appropriately in your browser.  This is also possible to automate, but
I'm not aware of any packaged tool which does so.  AFAIK neither Curl
nor wget support that; I tried them both at the time.  I once hacked
together some code to let AOLserver login as a client to other
websites (using some cookie handling code borrowed from tclwebtest):

  http://openacs.org/forums/message-view?message_id=278108

-- 
Andrew Piskorski <[EMAIL PROTECTED]>
http://www.piskorski.com/


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to