add Stat()
This commit is contained in:
@@ -26,7 +26,7 @@ func Fail(err interface{}) {
|
||||
fmt.Println(" CP | COPY <OLD_PATH> <NEW_PATH>")
|
||||
fmt.Println(" GET | PULL | READ <PATH>")
|
||||
fmt.Println(" PUT | PUSH | WRITE <PATH> <FILE>")
|
||||
|
||||
fmt.Println(" STAT <PATH>")
|
||||
}
|
||||
os.Exit(-1)
|
||||
}
|
||||
@@ -73,6 +73,13 @@ func main() {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
case "STAT":
|
||||
if file, err := c.Stat(path); err == nil {
|
||||
fmt.Println(file)
|
||||
} else {
|
||||
fmt.Println(err)
|
||||
}
|
||||
|
||||
case "GET", "PULL", "READ":
|
||||
if bytes, err := c.Read(path); err == nil {
|
||||
if lidx := strings.LastIndex(path, "/"); lidx != -1 {
|
||||
|
||||
Reference in New Issue
Block a user