diff options
| author | Chris Lu <chris.lu@gmail.com> | 2020-08-15 09:32:47 -0700 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2020-08-15 09:32:47 -0700 |
| commit | c647deace16ec1a3f0c11d92dc5fa15ec30012e4 (patch) | |
| tree | 7b13546507283b5566a069d03dc3371ccd2d7290 /weed/shell | |
| parent | c03bb180eb5fc96e79324f0aa5ec7cd9b674f901 (diff) | |
| download | seaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.tar.xz seaweedfs-c647deace16ec1a3f0c11d92dc5fa15ec30012e4.zip | |
file size support set file length
use Attr.FileSize and TotalChunkSize to determine file size
Diffstat (limited to 'weed/shell')
| -rw-r--r-- | weed/shell/command_fs_du.go | 6 | ||||
| -rw-r--r-- | weed/shell/command_fs_ls.go | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/weed/shell/command_fs_du.go b/weed/shell/command_fs_du.go index 96551dd5a..5404b0cdb 100644 --- a/weed/shell/command_fs_du.go +++ b/weed/shell/command_fs_du.go @@ -70,9 +70,9 @@ func duTraverseDirectory(writer io.Writer, filerClient filer_pb.FilerClient, dir } } else { fileBlockCount = uint64(len(entry.Chunks)) - fileByteCount = filer2.TotalSize(entry.Chunks) - blockCount += uint64(len(entry.Chunks)) - byteCount += filer2.TotalSize(entry.Chunks) + fileByteCount = filer2.FileSize(entry) + blockCount += fileBlockCount + byteCount += fileByteCount } if name != "" && !entry.IsDirectory { diff --git a/weed/shell/command_fs_ls.go b/weed/shell/command_fs_ls.go index 36133992f..4110c7b8d 100644 --- a/weed/shell/command_fs_ls.go +++ b/weed/shell/command_fs_ls.go @@ -95,7 +95,7 @@ func (c *commandFsLs) Do(args []string, commandEnv *CommandEnv, writer io.Writer fmt.Fprintf(writer, "%s %3d %s %s %6d %s/%s\n", fileMode, len(entry.Chunks), userName, groupName, - filer2.TotalSize(entry.Chunks), dir, entry.Name) + filer2.FileSize(entry), dir, entry.Name) } else { fmt.Fprintf(writer, "%s\n", entry.Name) } |
