Use hidden directory based on mount path

This commit is contained in:
Ben Johnson
2020-11-03 12:21:13 -07:00
parent 42f9ba9d1c
commit bcc6963db6
3 changed files with 53 additions and 16 deletions

View File

@@ -42,7 +42,7 @@ func NewNode(fs *FileSystem, path string) *Node {
}
func (n *Node) srcpath() string {
return filepath.Join(n.fs.SourcePath, n.path)
return filepath.Join(n.fs.TargetPath, n.path)
}
func (n *Node) Attr(ctx context.Context, a *fuse.Attr) (err error) {
@@ -82,7 +82,7 @@ func (n *Node) Attr(ctx context.Context, a *fuse.Attr) (err error) {
// Lookup need not to handle the names "." and "..".
func (n *Node) Lookup(ctx context.Context, name string) (_ fs.Node, err error) {
path := filepath.Join(n.path, name)
srcpath := filepath.Join(n.fs.SourcePath, path)
srcpath := filepath.Join(n.fs.TargetPath, path)
if _, err := os.Stat(srcpath); os.IsNotExist(err) {
return nil, syscall.ENOENT
}