diff --git a/client.go b/client.go index ec6cf93..a828436 100644 --- a/client.go +++ b/client.go @@ -133,20 +133,17 @@ func (c *Client) Remove(path string) error { } } -func (c *Client) Mkdir(path string) error { +func (c *Client) Mkdir(path string, _ os.FileMode) error { path = FixSlashes(path) status := c.mkcol(path) if status == 201 { return nil + } else { + return newPathError("Mkdir", path, status) } - - if status == 409 { - // TODO - } - - return errors.New(fmt.Sprintf("%d", status)) } + func (c *Client) Read(path string) { fmt.Println("Read " + path) } diff --git a/main/client.go b/main/client.go index 019414d..8d07d65 100644 --- a/main/client.go +++ b/main/client.go @@ -61,7 +61,7 @@ func main() { } case "MKCOL", "MKDIR": - if err := c.Mkdir(path); err != nil { + if err := c.Mkdir(path, 0); err != nil { fmt.Println(err) } else { fmt.Println("MkDir: " + path)