add min and max size filters
parsed by humanize
This commit is contained in:
parent
75370f719a
commit
a5654af0ff
5 changed files with 213 additions and 132 deletions
|
@ -116,7 +116,7 @@ func walk_dir(dir string, f *filter.Filter) (files Files) {
|
|||
|
||||
name := d.Name()
|
||||
info, _ := d.Info()
|
||||
if f.Match(name, info.ModTime(), info.IsDir()) {
|
||||
if f.Match(name, info.ModTime(), info.Size(), info.IsDir()) {
|
||||
log.Debugf("found matching file: %s %s", name, info.ModTime())
|
||||
i, err := os.Stat(p)
|
||||
if err != nil {
|
||||
|
@ -161,7 +161,7 @@ func read_dir(dir string, f *filter.Filter) (files Files) {
|
|||
|
||||
path := filepath.Dir(filepath.Join(dir, name))
|
||||
|
||||
if f.Match(name, info.ModTime(), info.IsDir()) {
|
||||
if f.Match(name, info.ModTime(), info.Size(), info.IsDir()) {
|
||||
log.Debugf("found matching file: %s %s", name, info.ModTime())
|
||||
files = append(files, File{
|
||||
name: name,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue