make filter Match on info instead of 9001 args
This commit is contained in:
parent
20f6dc92bc
commit
15bd040deb
4 changed files with 20 additions and 8 deletions
|
@ -125,7 +125,7 @@ func walk_dir(dir string, f *filter.Filter) (files Files) {
|
|||
|
||||
name := d.Name()
|
||||
info, _ := d.Info()
|
||||
if f.Match(name, info.ModTime(), info.Size(), info.IsDir()) {
|
||||
if f.Match(info) {
|
||||
log.Debugf("found matching file: %s %s", name, info.ModTime())
|
||||
i, err := os.Stat(p)
|
||||
if err != nil {
|
||||
|
@ -170,7 +170,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.Size(), info.IsDir()) {
|
||||
if f.Match(info) {
|
||||
log.Debugf("found matching file: %s %s", name, info.ModTime())
|
||||
files = append(files, DiskFile{
|
||||
name: name,
|
||||
|
|
|
@ -95,7 +95,7 @@ func FindTrash(trashdir, ogdir string, f *filter.Filter) (files Files, outerr er
|
|||
return nil
|
||||
}
|
||||
|
||||
if f.Match(filename, date, info.Size(), info.IsDir()) {
|
||||
if f.Match(info) {
|
||||
log.Debugf("%s: deleted on %s", filename, date.Format(trash_info_date_fmt))
|
||||
files = append(files, TrashInfo{
|
||||
name: filename,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue