add new command

closes #6

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
This commit is contained in:
Василий Толстов 2015-05-06 16:19:00 +03:00
parent d8b8730f40
commit 066a8d5b6c

View File

@ -55,6 +55,8 @@ func handle(c net.Conn) {
cmd := parts[0]
params := strings.Join(parts[1:], "")
switch cmd {
case "CDUP":
s.cmdServerCdup(params)
case "RNFR":
s.cmdServerRnfr(params)
case "OPTS":
@ -417,7 +419,12 @@ func (s *Conn) cmdServerCwd(args string) {
s.path = filepath.Clean(args)
}
s.ctrl.PrintfLine(`250 "%s" is current directory.`, s.path)
}
func (s *Conn) cmdServerCdup(args string) {
fmt.Printf("cmdServerCdup: %s\n", args)
s.path = filepath.Dir(s.path)
s.ctrl.PrintfLine(`250 "%s" is current directory.`, s.path)
}
func (s *Conn) cmdServerPort(args string) {