diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-05-13 23:56:16 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-05-13 23:56:16 -0700 |
| commit | c5cf9bd29046877ed6b173e5d2723f865d06aa66 (patch) | |
| tree | 4e5aeb06f0f319aeb29135b44581e31dd80b662a /weed/command | |
| parent | f01d5616b3dba0779d2adbe361271a8f9626e8ee (diff) | |
| download | seaweedfs-c5cf9bd29046877ed6b173e5d2723f865d06aa66.tar.xz seaweedfs-c5cf9bd29046877ed6b173e5d2723f865d06aa66.zip | |
properly working filer
Diffstat (limited to 'weed/command')
| -rw-r--r-- | weed/command/filer_copy.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/weed/command/filer_copy.go b/weed/command/filer_copy.go index da7fb43bb..2b286d3d8 100644 --- a/weed/command/filer_copy.go +++ b/weed/command/filer_copy.go @@ -91,14 +91,14 @@ func runCopy(cmd *Command, args []string) bool { func doEachCopy(fileOrDir string, host string, path string) bool { f, err := os.Open(fileOrDir) if err != nil { - fmt.Printf("Failed to open file %s: %v", fileOrDir, err) + fmt.Printf("Failed to open file %s: %v\n", fileOrDir, err) return false } defer f.Close() fi, err := f.Stat() if err != nil { - fmt.Printf("Failed to get stat for file %s: %v", fileOrDir, err) + fmt.Printf("Failed to get stat for file %s: %v\n", fileOrDir, err) return false } @@ -122,22 +122,22 @@ func doEachCopy(fileOrDir string, host string, path string) bool { parts, err := operation.NewFileParts([]string{fileOrDir}) if err != nil { - fmt.Printf("Failed to read file %s: %v", fileOrDir, err) + fmt.Printf("Failed to read file %s: %v\n", fileOrDir, err) } results, err := operation.SubmitFiles(*copy.master, parts, *copy.replication, *copy.collection, "", *copy.ttl, *copy.maxMB, copy.secret) if err != nil { - fmt.Printf("Failed to submit file %s: %v", fileOrDir, err) + fmt.Printf("Failed to submit file %s: %v\n", fileOrDir, err) } if strings.HasSuffix(path, "/") { path = path + fi.Name() } - if err = filer_operation.RegisterFile(host, path, results[0].Fid, copy.secret); err != nil { - fmt.Printf("Failed to register file %s on %s: %v", fileOrDir, host, err) + if err = filer_operation.RegisterFile(host, path, results[0].Fid, parts[0].FileSize, copy.secret); err != nil { + fmt.Printf("Failed to register file %s on %s: %v\n", fileOrDir, host, err) return false } |
