Ftp question : TCL
This is a discussion on Ftp question within the TCL forums in Programming Languages category; I am getting the following error from the ftp package found in tcllib. I am connected to the Internet and can open an Ftp session froma graphical ftp client: I am on Windows XP. I am new to ftp so I am not sure if this is a genuine connection time out issue or a bug? % package require ftp 2.4.8 % package require ftp::geturl 0.2.1 % set f [ftp::Open ftp://my-ftp-server $username $passwd] error error | E: Service not available!: error can't read "ftp(DummySock)": no such element in array error while executing error "close $ftp(DummySock)" error error | E: Not ...
![]() |
| | LinkBack | Thread Tools |
|
#1
| |||
| |||
| tcllib. I am connected to the Internet and can open an Ftp session froma graphical ftp client: I am on Windows XP. I am new to ftp so I am not sure if this is a genuine connection time out issue or a bug? % package require ftp 2.4.8 % package require ftp::geturl 0.2.1 % set f [ftp::Open ftp://my-ftp-server $username $passwd] error error | E: Service not available!: error can't read "ftp(DummySock)": no such element in array error while executing error "close $ftp(DummySock)" error error | E: Not connected!: error can't read "ftp(DummySock)": no such element in array error while executing error "close $ftp(DummySock)" -1 Another time, it just returned 0 with no handles. Documentation indicates that this means success. How do I get at the handle? |
|
#2
| |||
| |||
| newtophp2000@yahoo.com wrote: > I am getting the following error from the ftp package found in > tcllib. I am connected to the Internet and can open an Ftp session > froma graphical ftp client: I am on Windows XP. > > > I am new to ftp so I am not sure if this is a genuine connection time > out issue or a bug? > > > % package require ftp > 2.4.8 > % package require ftp::geturl > 0.2.1 > % set f [ftp::Open ftp://my-ftp-server $username $passwd] this should be: set f [ftp::Open my-fwp-server $username $passwd] > error error | E: Service not available!: > error can't read "ftp(DummySock)": no such element in array > error while executing > error "close $ftp(DummySock)" > error error | E: Not connected!: > error can't read "ftp(DummySock)": no such element in array > error while executing > error "close $ftp(DummySock)" > -1 > > > Another time, it just returned 0 with no handles. Documentation > indicates that this means success. How do I get at the handle? > > > -- +--------------------------------+---------------------------------------+ | Gerald W. Lester | |"The man who fights for his ideals is the man who is alive." - Cervantes| +------------------------------------------------------------------------+ |
|
#3
| |||
| |||
| On Jan 25, 3:30 pm, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote: > > % set f [ftp::Openftp://my-ftp-server$username $passwd] > > this should be: > set f [ftp::Open my-fwp-server $username $passwd] > Thank you! That helped. I noticed a couple of things: 1) This always returns an error instead of an empty list. The file named "index.html" is a file not a directory so the pattern should not match any files. % set p [ftp::NList 1 index.html/*] error error | E: Error getting directory listing!: error can't read "ftp(SourceCI)": no such element in array error while executing error "close $ftp(SourceCI)" 2) This prints out the files but does not return them in a list so I can use it: % set p [ftp::List 1] <<<<prints out a list of files in ls-l mode <<<<<<< However, the variable "p" remains empty. |
|
#4
| |||
| |||
| On Jan 25, 9:53 pm, newtophp2...@yahoo.com wrote: > On Jan 25, 3:30 pm, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote: > > > > % set f [ftp::Openftp://my-ftp-server$username$passwd] > > > this should be: > > set f [ftp::Open my-fwp-server $username $passwd] > > Thank you! That helped. > > I noticed a couple of things: > > 1) This always returns an error instead of an empty list. The file > named "index.html" is a file not a directory so the pattern should not > match any files. > > % set p [ftp::NList 1 index.html/*] > error error | E: Error getting directory listing!: > error can't read "ftp(SourceCI)": no such element in array > error while executing > error "close $ftp(SourceCI)" > > 2) This prints out the files but does not return them in a list so I > can use it: > > % set p [ftp::List 1] > > <<<<prints out a list of files in ls-l mode <<<<<<< > > However, the variable "p" remains empty. Are you running this from TkCon? Because the ftp package changes the way List displays it output when run from TkCon (which is silly if you ask me). You can still use ftp::List_org. Mark |
|
#5
| |||
| |||
| On Jan 25, 4:11 pm, Mark Janssen <mpc.jans...@gmail.com> wrote: > Are you running this from TkCon? Because the ftp package changes the > way List displays it output when run from TkCon (which is silly if you > ask me). You can still use ftp::List_org. How interesting! Yes, I just confirmed it. When I run it from Wish, everything is fine. Thanks for the tip! By the way, what is the proper way of disconnecting? I am using "ftp::Close 1" where 1 is the id I get from ftp::Open. It just hangs there causing my PC to work up. AFter several minutes, I have to stop it from the windows task manager. |

