MCPcopy Index your code
hub / github.com/CovenantSQL/CovenantSQL / Lookup

Method Lookup

cmd/cql-fuse/node.go:209–222  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

207//
208// Lookup need not to handle the names "." and "..".
209func (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.
225func (n *Node) ReadDirAll(_ context.Context) ([]fuse.Dirent, error) {

Callers

nothing calls this directly

Calls 2

isDirMethod · 0.95
lookupMethod · 0.80

Tested by

no test coverage detected