From 066a8d5b6c744a1f22bde6de480c91015200f407 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 6 May 2015 16:19:00 +0300 Subject: [PATCH] add new command closes #6 Signed-off-by: Vasiliy Tolstov --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.go b/main.go index 598a079..d48d958 100644 --- a/main.go +++ b/main.go @@ -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) {