improve export data as hex for gres

This commit is contained in:
john
2019-09-01 21:34:15 +08:00
parent 15a6680833
commit 6ccc4d119f
7 changed files with 21 additions and 20 deletions

View File

@ -8,6 +8,8 @@ package gres
import (
"fmt"
"github.com/gogf/gf/os/gtime"
"os"
"path/filepath"
"strings"
@ -209,8 +211,10 @@ func (r *Resource) doScanDir(path string, pattern string, recursive bool, onlyFi
// Dump prints the files of current resource object.
func (r *Resource) Dump() {
var info os.FileInfo
r.tree.Iterator(func(key, value interface{}) bool {
fmt.Printf("%7s %s\n", gfile.FormatSize(value.(*File).FileInfo().Size()), key)
info = value.(*File).FileInfo()
fmt.Printf("%v %7s %s\n", gtime.New(info.ModTime()).ISO8601(), gfile.FormatSize(info.Size()), key)
return true
})
fmt.Printf("TOTAL FILES: %d\n", r.tree.Size())