all repos — flounder @ ea5e67c4e14bd7fc12d4a64118252a2dbc3a1abb

A small site builder for the Gemini protocol

add rename command

Fix
alex wennerberg alex@alexwennerberg.com
Sat, 27 Feb 2021 09:46:23 -0800
commit

ea5e67c4e14bd7fc12d4a64118252a2dbc3a1abb

parent

6a448532723ac8abf673b4964260d8f4a4ed2fb2

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M sftp.gosftp.go

@@ -76,12 +76,15 @@ func (conn *Connection) Filecmd(request *sftp.Request) error {

// remove, rename, setstat? find out userDir := getUserDirectory(conn.User) // NOTE -- not cross platform fullpath := path.Join(userDir, filepath.Clean(request.Filepath)) + targetPath := path.Join(userDir, filepath.Clean(request.Target)) var err error switch request.Method { case "Remove": err = os.Remove(fullpath) case "Mkdir": err = os.Mkdir(fullpath, 0755) + case "Rename": + err = os.Rename(fullpath, targetPath) } if err != nil { return err