Ofloo wrote:could you give a small example not sur on what you mean ..? just wana know how you trigger an eof
Hi there Ofloo. An example script can be found at:
http://members.fortunecity.com/eggheadtcl
script: demo-ftpconnect.tcl
In case of a connection that fails because of a DNS lookup error or a connection refused, the [connect] immediately fails which must be catch'ed.
If the connection succeeds the FTP server will send a status code 220 to indicate the server is ready to accept commands.
If the FTP server closes a connection, a blank line will be send to your script.
(Note that if the FTP server sends a blank line, nothing will be send to your script.)
There are some things you may want to (re)consider.
1. If you do want to write your own script you will have to dive a bit into the FTP RFC. Additionally, if you are new to listen/connect/control or Tcl socket programming you probably will need to put quite some time into it.
2. There is a FTP package available in the standard tcllib. Use google to locate the tcllib on e.g. sourceforge. This package may give you a more convenient interface between your eggdrop and an FTP server.
3. Also a shell program like "wget" can connect to ftp servers and download the directory listings. Using such shell program may offer another convenient interface.