better indexing and classifier
This commit is contained in:
parent
38c2a72fe0
commit
98b53d3a33
9 changed files with 168 additions and 32 deletions
|
|
@ -25,12 +25,17 @@ type Filesystem struct {
|
|||
}
|
||||
|
||||
func NewFilesystem(base string) (fs *Filesystem, err error) {
|
||||
if !filepath.IsAbs(base) {
|
||||
err = errors.New("base dir '" + base + "' is not an absolute path")
|
||||
return
|
||||
}
|
||||
fi, err := os.Stat(base)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if !fi.IsDir() {
|
||||
err = errors.New("base dir '" + base + "' is not a directory")
|
||||
return
|
||||
}
|
||||
fs = &Filesystem{base}
|
||||
return
|
||||
|
|
@ -68,7 +73,7 @@ func (fs *Filesystem) ReadDir(path string) (d *Directory) {
|
|||
}
|
||||
|
||||
func (fs *Filesystem) Recursive(p string) (paths core.Paths) {
|
||||
p = Clean(p)
|
||||
p, _ = filepath.Split(Clean(p))
|
||||
if len(p) >= 2 {
|
||||
p = p[:len(p)-1]
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue