Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go-fuse
Commits
34f05b48
Commit
34f05b48
authored
Sep 16, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pretty print debug data.
parent
e06b2172
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
fuse/Makefile
fuse/Makefile
+1
-0
fuse/typeprint.go
fuse/typeprint.go
+63
-0
No files found.
fuse/Makefile
View file @
34f05b48
...
...
@@ -29,6 +29,7 @@ MANUAL_GOFILES=api.go \
readonlyfs.go
\
request.go
\
switchfs.go
\
typeprint.go
\
types.go
\
version.go
\
xattr.go
\
...
...
fuse/typeprint.go
0 → 100644
View file @
34f05b48
package
fuse
import
(
"fmt"
"os"
"strings"
)
var
openFlags
map
[
int
]
string
func
init
()
{
openFlags
=
map
[
int
]
string
{
os
.
O_WRONLY
:
"O_WRONLY"
,
os
.
O_RDWR
:
"O_RDWR"
,
os
.
O_APPEND
:
"O_APPEND"
,
os
.
O_ASYNC
:
"O_ASYNC"
,
os
.
O_CREATE
:
"O_CREAT"
,
os
.
O_EXCL
:
"O_EXCL"
,
os
.
O_NOCTTY
:
"O_NOCTTY"
,
os
.
O_NONBLOCK
:
"O_NONBLOCK"
,
os
.
O_SYNC
:
"O_SYNC"
,
os
.
O_TRUNC
:
"O_TRUNC"
,
}
}
func
(
me
*
OpenIn
)
String
()
string
{
s
:=
[]
string
{}
for
k
,
v
:=
range
openFlags
{
if
me
.
Flags
&
uint32
(
k
)
!=
0
{
s
=
append
(
s
,
v
)
}
}
if
len
(
s
)
==
0
{
s
=
[]
string
{
"O_RDONLY"
}
}
return
fmt
.
Sprintf
(
"[%s]"
,
strings
.
Join
(
s
,
" | "
))
}
func
(
me
*
SetAttrIn
)
String
()
string
{
s
:=
[]
string
{}
if
me
.
Valid
&
FATTR_MODE
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"mode %o"
,
me
.
Mode
))
}
if
me
.
Valid
&
FATTR_UID
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"uid %d"
,
me
.
Uid
))
}
if
me
.
Valid
&
FATTR_GID
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"uid %d"
,
me
.
Gid
))
}
if
me
.
Valid
&
FATTR_SIZE
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"uid %d"
,
me
.
Size
))
}
if
me
.
Valid
&
FATTR_ATIME
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"atime %d %d"
,
me
.
Atime
,
me
.
Atimensec
))
}
if
me
.
Valid
&
FATTR_MTIME
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"mtime %d %d"
,
me
.
Mtime
,
me
.
Mtimensec
))
}
if
me
.
Valid
&
FATTR_MTIME
!=
0
{
s
=
append
(
s
,
fmt
.
Sprintf
(
"fh %d"
,
me
.
Fh
))
}
// TODO - FATTR_ATIME_NOW = (1 << 7), FATTR_MTIME_NOW = (1 << 8), FATTR_LOCKOWNER = (1 << 9)
return
fmt
.
Sprintf
(
"[%s]"
,
strings
.
Join
(
s
,
", "
))
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment