mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-01 05:28:30 +00:00
vis: adding a pure golang Vis()
The current Vis() and Unvis() are using the C implementation from MTREE(8). But that means that cgo is used, which is not always desired. Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
e42c679e89
commit
08b1000418
19 changed files with 580 additions and 61 deletions
2
entry.go
2
entry.go
|
@ -47,7 +47,7 @@ func (e Entry) Descend(filename string) *Entry {
|
|||
func (e Entry) Find(filepath string) *Entry {
|
||||
resultnode := &e
|
||||
for _, path := range strings.Split(filepath, "/") {
|
||||
encoded, err := Vis(path)
|
||||
encoded, err := Vis(path, DefaultVisFlags)
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue