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
Levin Zimmermann
go-fuse
Commits
00bf79b1
Commit
00bf79b1
authored
Jul 06, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Run gofmt in example/
parent
b3ea7e6b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
example/autounionfs/main.go
example/autounionfs/main.go
+1
-1
example/bulkstat/bulkstat.go
example/bulkstat/bulkstat.go
+7
-7
example/hello/hello.go
example/hello/hello.go
+4
-4
example/multizip/multizip.go
example/multizip/multizip.go
+1
-1
No files found.
example/autounionfs/main.go
View file @
00bf79b1
...
...
@@ -38,7 +38,7 @@ func main() {
EntryTimeout
:
1.0
,
AttrTimeout
:
1.0
,
NegativeTimeout
:
1.0
,
Owner
:
fuse
.
CurrentOwner
(),
Owner
:
fuse
.
CurrentOwner
(),
},
UpdateOnMount
:
true
,
}
...
...
example/bulkstat/bulkstat.go
View file @
00bf79b1
...
...
@@ -75,21 +75,21 @@ func Analyze(times []float64) {
avg
:=
tot
/
n
variance
:=
0.0
for
_
,
v
:=
range
times
{
variance
+=
(
v
-
avg
)
*
(
v
-
avg
)
variance
+=
(
v
-
avg
)
*
(
v
-
avg
)
}
variance
/=
n
stddev
:=
math
.
Sqrt
(
variance
)
median
:=
sorted
[
len
(
times
)
/
2
]
perc90
:=
sorted
[
int
(
n
*
0.9
)]
perc10
:=
sorted
[
int
(
n
*
0.1
)]
perc90
:=
sorted
[
int
(
n
*
0.9
)]
perc10
:=
sorted
[
int
(
n
*
0.1
)]
fmt
.
Printf
(
"%d samples
\n
"
+
"avg %.2f ms 2sigma %.2f "
+
"median %.2fms
\n
"
+
"10%%tile %.2fms, 90%%tile %.2fms
\n
"
,
"%d samples
\n
"
+
"avg %.2f ms 2sigma %.2f "
+
"median %.2fms
\n
"
+
"10%%tile %.2fms, 90%%tile %.2fms
\n
"
,
len
(
times
),
avg
,
2
*
stddev
,
median
,
perc10
,
perc90
)
}
...
...
example/hello/hello.go
View file @
00bf79b1
...
...
@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string) (*os.FileInfo, fuse.Status) {
case
"file.txt"
:
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFREG
|
0644
,
Size
:
int64
(
len
(
name
)),
},
fuse
.
OK
},
fuse
.
OK
case
""
:
return
&
os
.
FileInfo
{
Mode
:
fuse
.
S_IFDIR
|
0755
,
},
fuse
.
OK
},
fuse
.
OK
}
return
nil
,
fuse
.
ENOENT
}
...
...
@@ -30,7 +30,7 @@ func (me *HelloFs) GetAttr(name string) (*os.FileInfo, fuse.Status) {
func
(
me
*
HelloFs
)
OpenDir
(
name
string
)
(
c
chan
fuse
.
DirEntry
,
code
fuse
.
Status
)
{
if
name
==
""
{
c
=
make
(
chan
fuse
.
DirEntry
,
1
)
c
<-
fuse
.
DirEntry
{
Name
:
"file.txt"
,
Mode
:
fuse
.
S_IFREG
}
c
<-
fuse
.
DirEntry
{
Name
:
"file.txt"
,
Mode
:
fuse
.
S_IFREG
}
close
(
c
)
return
c
,
fuse
.
OK
}
...
...
@@ -41,7 +41,7 @@ func (me *HelloFs) Open(name string, flags uint32) (file fuse.File, code fuse.St
if
name
!=
"file.txt"
{
return
nil
,
fuse
.
ENOENT
}
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
return
fuse
.
NewReadOnlyFile
([]
byte
(
name
)),
fuse
.
OK
...
...
example/multizip/multizip.go
View file @
00bf79b1
...
...
@@ -27,7 +27,7 @@ func main() {
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
}
state
.
Debug
=
*
debug
state
.
Loop
(
true
)
}
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