Create of regular file. (not a dir) Flags are always 514: O_CREAT is 0x200 | O_RDWR is 0x2. From fuse_vnops.c: /* XXX: We /always/ creat() like this. Wish we were on Linux. */ foi->flags = O_CREAT | O_RDWR; 2013/07/21 05:26:35 <- &{Create [ID=0x3 Node=0x8 Uid=61652 Gid=5000 Pid=13115] "x" fl=5
(ctx context.Context, req *fuse.CreateRequest, res *fuse.CreateResponse)
| 306 | // 2013/07/21 05:26:35 <- &{Create [ID=0x3 Node=0x8 Uid=61652 Gid=5000 Pid=13115] "x" fl=514 mode=-rw-r--r-- fuse.Intr} |
| 307 | // 2013/07/21 05:26:36 -> 0x3 Create {LookupResponse:{Node:23 Generation:0 EntryValid:1m0s AttrValid:1m0s Attr:{Inode:15976986887557313215 Size:0 Blocks:0 Atime:2013-07-21 05:23:51.537251251 +1200 NZST Mtime:2013-07-21 05:23:51.537251251 +1200 NZST Ctime:2013-07-21 05:23:51.537251251 +1200 NZST Crtime:2013-07-21 05:23:51.537251251 +1200 NZST Mode:-rw------- Nlink:1 Uid:61652 Gid:5000 Rdev:0 Flags:0}} OpenResponse:{Handle:1 Flags:0}} |
| 308 | func (n *mutDir) Create(ctx context.Context, req *fuse.CreateRequest, res *fuse.CreateResponse) (fs.Node, fs.Handle, error) { |
| 309 | child, err := n.creat(ctx, req.Name, fileType) |
| 310 | if err != nil { |
| 311 | Logger.Printf("mutDir.Create(%q): %v", req.Name, err) |
| 312 | return nil, nil, handleEIOorEINTR(err) |
| 313 | } |
| 314 | |
| 315 | // Create and return a file handle. |
| 316 | h, ferr := child.(*mutFile).newHandle(nil) |
| 317 | if ferr != nil { |
| 318 | return nil, nil, ferr |
| 319 | } |
| 320 | |
| 321 | return child, h, nil |
| 322 | } |
| 323 | |
| 324 | func (n *mutDir) Mkdir(ctx context.Context, req *fuse.MkdirRequest) (fs.Node, error) { |
| 325 | child, err := n.creat(ctx, req.Name, dirType) |