File: print_darwin.go

package info (click to toggle)
golang-github-hanwen-go-fuse 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,584 kB
  • sloc: cpp: 78; sh: 47; makefile: 16
file content (44 lines) | stat: -rw-r--r-- 1,239 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2016 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package fuse

import (
	"fmt"
)

func init() {
	initFlagNames.set(CAP_NODE_RWLOCK, "NODE_RWLOCK")
	initFlagNames.set(CAP_RENAME_SWAP, "RENAME_SWAP")
	initFlagNames.set(CAP_RENAME_EXCL, "RENAME_EXCL")
	initFlagNames.set(CAP_ALLOCATE, "ALLOCATE")
	initFlagNames.set(CAP_EXCHANGE_DATA, "EXCHANGE_DATA")
	initFlagNames.set(CAP_XTIMES, "XTIMES")
	initFlagNames.set(CAP_VOL_RENAME, "VOL_RENAME")
	initFlagNames.set(CAP_CASE_INSENSITIVE, "CASE_INSENSITIVE")
}

func (me *CreateIn) string() string {
	return fmt.Sprintf(
		"{0%o [%s]}", me.Mode,
		flagString(openFlagNames, int64(me.Flags), "O_RDONLY"))
}

func (me *GetAttrIn) string() string { return "" }

func (me *MknodIn) string() string {
	return fmt.Sprintf("{0%o, %d}", me.Mode, me.Rdev)
}

func (me *ReadIn) string() string {
	return fmt.Sprintf("{Fh %d [%d +%d) %s}",
		me.Fh, me.Offset, me.Size,
		flagString(readFlagNames, int64(me.ReadFlags), ""))
}

func (me *WriteIn) string() string {
	return fmt.Sprintf("{Fh %d [%d +%d) %s}",
		me.Fh, me.Offset, me.Size,
		flagString(writeFlagNames, int64(me.WriteFlags), ""))
}