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)
| 233 | // We let the sql query fail if the directory already exists. |
| 234 | // TODO(marc): better handling of errors. |
| 235 | func (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. |
| 252 | func (n *Node) Create( |