mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-04 14:48:29 +00:00
-d: exclude non-directories
Adding flag, and supporting functionality for exluding entries that are non-directories Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
353436a031
commit
c0a5cb25ec
7 changed files with 117 additions and 15 deletions
5
walk.go
5
walk.go
|
@ -15,6 +15,11 @@ import (
|
|||
// returns true, then the path is not included in the spec.
|
||||
type ExcludeFunc func(path string, info os.FileInfo) bool
|
||||
|
||||
// ExcludeNonDirectories is an ExcludeFunc for excluding all paths that are not directories
|
||||
var ExcludeNonDirectories = func(path string, info os.FileInfo) bool {
|
||||
return !info.IsDir()
|
||||
}
|
||||
|
||||
var defaultSetKeywords = []KeyVal{"type=file", "nlink=1", "flags=none", "mode=0664"}
|
||||
|
||||
// Walk from root directory and assemble the DirectoryHierarchy. excludes
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue