diff --git a/cmd/files.go b/cmd/files.go index 67f02a1..8bc4817 100644 --- a/cmd/files.go +++ b/cmd/files.go @@ -10,6 +10,7 @@ import ( "io/fs" "math/big" "regexp" + "slices" "crypto/rand" "os" @@ -461,6 +462,8 @@ Poll: ) } + slices.Sort(list) + return list, nil } diff --git a/cmd/index.go b/cmd/index.go index 3cb8f2a..7cbb60b 100644 --- a/cmd/index.go +++ b/cmd/index.go @@ -111,11 +111,17 @@ func (index *fileIndex) Export(path string) error { length := len(index.list) index.mutex.RUnlock() + stats, err := file.Stat() + if err != nil { + return err + } + if Verbose { - fmt.Printf("%s | INDEX: Exported %d entries to %s in %s\n", + fmt.Printf("%s | INDEX: Exported %d entries to %s (%s) in %s\n", time.Now().Format(logDate), length, path, + humanReadableSize(int(stats.Size())), time.Since(startTime), ) } @@ -132,6 +138,11 @@ func (index *fileIndex) Import(path string) error { } defer file.Close() + stats, err := file.Stat() + if err != nil { + return err + } + z, err := zstd.NewReader(file) if err != nil { return err @@ -149,10 +160,11 @@ func (index *fileIndex) Import(path string) error { index.mutex.Unlock() if Verbose { - fmt.Printf("%s | INDEX: Imported %d entries from %s in %s\n", + fmt.Printf("%s | INDEX: Imported %d entries from %s (%s) in %s\n", time.Now().Format(logDate), length, path, + humanReadableSize(int(stats.Size())), time.Since(startTime), ) }