For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2006 > FTP using script file









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FTP using script file
charles.leviton@gmail.com

2006-01-25, 7:15 pm

Just getting my feet wet here. Wonder if someone could point me to how
to use the ftp package that comes with tcl to accept a script file that
contains the OPEN and USER and PUT commands and so on.
With regular command line ftp I would use the -s option to accomplish
this but I cannot figure out from the help documentation where I
provide this when I use the ftp package.

Thanks

Cameron Laird

2006-01-26, 3:59 am

In article <1138216892.186453.189420@z14g2000cwz.googlegroups.com>,
<charles.leviton@gmail.com> wrote:
>Just getting my feet wet here. Wonder if someone could point me to how
>to use the ftp package that comes with tcl to accept a script file that
>contains the OPEN and USER and PUT commands and so on.
>With regular command line ftp I would use the -s option to accomplish
>this but I cannot figure out from the help documentation where I
>provide this when I use the ftp package.

charles.leviton@gmail.com

2006-01-27, 7:03 pm

Thanks. I had visited that website and looked at the ftp help page as
well. I didn't find an option to provide a file name using something
equivalent to the -s parameter.

Gerald W. Lester

2006-01-27, 7:03 pm

charles.leviton@gmail.com wrote:
> Thanks. I had visited that website and looked at the ftp help page as
> well. I didn't find an option to provide a file name using something
> equivalent to the -s parameter.
>


The ftp package in tcllib (please note that tcl itself does not come with an
ftp command) does not provide anything like the -s option. Tcl is a
programming language and the package provides a tcl level api to most of the
FTP protocol.

Additionally there is the FTP virtual file system, which makes a remote ftp
site look like part of the local file system. This is so that your program
can open, read/write, and close files using the normal tcl commands.

It should be a trivial procedure for you to write to take a .scr file of the
format expected by the -s option of the ftp utility and use the tcllib ftp
package to "execute" those commands.

Of course you could always just do:
exec ftp -s foobar.scr
charles.leviton@gmail.com

2006-01-27, 9:57 pm

Thanks. I had some difficulty with the exec ftp approach and while
searching on ftp in this forum I came across references to the ftp
package.
Now that you have clarified it I realize I was barking up the wrong
tree in thinking that the ftp package should support a -s option.
Your suggestion is right- I can iterate thru a .scr file and submit
each line as a parm to "ftp::"

Regards

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com