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

Method Mkdir

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

Mkdir creates a directory in 'n'. We let the sql query fail if the directory already exists. TODO(marc): better handling of errors.

(ctx context.Context, req *fuse.MkdirRequest)

Source from the content-addressed store, hash-verified

233// We let the sql query fail if the directory already exists.
234// TODO(marc): better handling of errors.
235func (n *Node) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error) {
236 if !n.isDir() {
237 return nil, fuse.Errno(syscall.ENOTDIR)
238 }
239 if !req.Mode.IsDir() {
240 return nil, fuse.Errno(syscall.ENOTDIR)
241 }
242
243 node := n.cfs.newDirNode()
244 err := n.cfs.create(ctx, n.ID, req.Name, node)
245 if err != nil {
246 return nil, err
247 }
248 return node, nil
249}
250
251// Create creates a new file in the receiver directory.
252func (n *Node) Create(

Callers 2

TestDefaultInitFunction · 0.80
runGenerateFunction · 0.80

Calls 3

isDirMethod · 0.95
newDirNodeMethod · 0.80
createMethod · 0.80

Tested by 1

TestDefaultInitFunction · 0.64