fix Mkdir signature

This commit is contained in:
Christoph Polcin 2014-10-24 11:30:08 +02:00
parent 3e22786a18
commit 9e2acd491b
2 changed files with 5 additions and 8 deletions

View File

@ -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) path = FixSlashes(path)
status := c.mkcol(path) status := c.mkcol(path)
if status == 201 { if status == 201 {
return nil 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) { func (c *Client) Read(path string) {
fmt.Println("Read " + path) fmt.Println("Read " + path)
} }

View File

@ -61,7 +61,7 @@ func main() {
} }
case "MKCOL", "MKDIR": case "MKCOL", "MKDIR":
if err := c.Mkdir(path); err != nil { if err := c.Mkdir(path, 0); err != nil {
fmt.Println(err) fmt.Println(err)
} else { } else {
fmt.Println("MkDir: " + path) fmt.Println("MkDir: " + path)