Updated 2012-09-08 16:42:04 by RLE

http://tcllib.sourceforge.net/doc/ftpd.html

A small and simple ftp demon, written by Matt Newman.

PASV

Here's a sample script that configures and starts the ftpd server:
namespace eval ::ftpd {
    variable welcome "tcllib FTP server on [info hostname] ready."
}
package require ftpd

proc myAuthUsrCmd {user pass} {
    puts "accepting everything: $user/$pass"
    return 1
}
proc myLogCmd {lvl msg} {
    if {$lvl eq "note"} {
        puts stderr $msg
    } else {
        puts stderr "\[$lvl\] $msg"
    }
}
::ftpd::config -authUsrCmd myAuthUsrCmd -logCmd myLogCmd
::ftpd::fsFile::docRoot c:/myFtpRoot
::ftpd::server

if {! [info exists tk_version]} {
    vwait forever
}
return