Lookup looks up a specific entry in the receiver, which must be a directory. Lookup should return a Node corresponding to the entry. If the name does not exist in the directory, Lookup should return ENOENT. Lookup need not to handle the names "." and "..".
(_ context.Context, name string)
| 207 | // |
| 208 | // Lookup need not to handle the names "." and "..". |
| 209 | func (n *Node) Lookup(_ context.Context, name string) (fs.Node, error) { |
| 210 | if !n.isDir() { |
| 211 | return nil, fuse.Errno(syscall.ENOTDIR) |
| 212 | } |
| 213 | node, err := n.cfs.lookup(n.ID, name) |
| 214 | if err != nil { |
| 215 | if err == sql.ErrNoRows { |
| 216 | return nil, fuse.ENOENT |
| 217 | } |
| 218 | return nil, err |
| 219 | } |
| 220 | node.cfs = n.cfs |
| 221 | return node, nil |
| 222 | } |
| 223 | |
| 224 | // ReadDirAll returns the list of child inodes. |
| 225 | func (n *Node) ReadDirAll(_ context.Context) ([]fuse.Dirent, error) { |