Initial commit
This commit is contained in:
30
ffs/util.go
Normal file
30
ffs/util.go
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user