31 lines
360 B
Go
31 lines
360 B
Go
package ffs
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"bazil.org/fuse"
|
|
"bazil.org/fuse/fs"
|
|
)
|
|
|
|
type TopLevelDir interface {
|
|
fs.Node
|
|
GetAttr() *fuse.Attr
|
|
}
|
|
|
|
func IsValidName(name string) bool {
|
|
l := len(name)
|
|
if l == 0 || l > 255 {
|
|
return false
|
|
}
|
|
|
|
if name == "." || name == ".." {
|
|
return false
|
|
}
|
|
|
|
if strings.ContainsRune(name, '/') {
|
|
return false
|
|
}
|
|
|
|
return true
|
|
}
|