Work in progress
This commit is contained in:
parent
920dc8c841
commit
bc51db532c
18
version.go
18
version.go
@ -31,6 +31,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -53,7 +54,7 @@ type version struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newVersion(base string, parent *version) (*version, error) {
|
func newVersion(base string, parent *version) (*version, error) {
|
||||||
re, err := regexp.Compile(`/vfs_([0-9a-f])$`)
|
re, err := regexp.Compile(`^vfs_([0-9a-f])$`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@ -202,3 +203,18 @@ func (this *version) allocInode() uint64 {
|
|||||||
func (this *version) Root() (fs.Node, error) {
|
func (this *version) Root() (fs.Node, error) {
|
||||||
return this.root, nil
|
return this.root, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *version) dump(root *versionedDir, depth int) {
|
||||||
|
indent := strings.Repeat("\t", depth)
|
||||||
|
for name, dir := range root.dirs {
|
||||||
|
fmt.Printf("%s%s (%s) >\n", indent, name, dir.node.path)
|
||||||
|
this.dump(dir, depth+1)
|
||||||
|
}
|
||||||
|
for name, file := range root.files {
|
||||||
|
fmt.Printf("%s%s (%s)\n", indent, name, file.node.path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (this *version) dumpRoot() {
|
||||||
|
this.dump(this.root, 0)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user