diff --git a/cmd-ls.go b/cmd-ls.go index 8233a229..f04f530c 100644 --- a/cmd-ls.go +++ b/cmd-ls.go @@ -46,7 +46,7 @@ func printItems(v []*client.Item) { // printItem prints item meta-data func printItem(date time.Time, v int64, name string) { fmt.Printf(console.Time("[%s] ", date.Local().Format(printDate))) - fmt.Printf(console.Size("%5s ", humanize.Bytes(uint64(v)))) + fmt.Printf(console.Size("%6s ", humanize.IBytes(uint64(v)))) fmt.Println(console.File("%s", name)) } diff --git a/pkg/client/fs/fs_test.go b/pkg/client/fs/fs_test.go index 914ffd51..e77e37b1 100644 --- a/pkg/client/fs/fs_test.go +++ b/pkg/client/fs/fs_test.go @@ -68,7 +68,7 @@ func (s *MySuite) TestList(c *C) { fsc = New(root) items, err := fsc.List() c.Assert(err, IsNil) - c.Assert(len(items), Equals, 2) + c.Assert(len(items), Equals, 3) } func (s *MySuite) TestPutBucket(c *C) { diff --git a/pkg/client/fs/fs_unix.go b/pkg/client/fs/fs_unix.go index 570827cf..a612d33a 100644 --- a/pkg/client/fs/fs_unix.go +++ b/pkg/client/fs/fs_unix.go @@ -119,15 +119,13 @@ func (f *fsClient) List() (items []*client.Item, err error) { } return err // fatal } - if fi.IsDir() { - return nil // not a fs skip - } - // trim f.path item := &client.Item{ - Name: strings.TrimPrefix(fp, f.path+string(filepath.Separator)), + // Name: strings.TrimPrefix(fp, f.path+string(filepath.Separator)), + Name: fp, Time: fi.ModTime(), Size: fi.Size(), } + items = append(items, item) return nil }