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
b1188e32
Commit
b1188e32
authored
Mar 29, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
example/zipfs: use new nodefs
parent
b5b6396e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
example/zipfs/main.go
example/zipfs/main.go
+8
-7
No files found.
example/zipfs/main.go
View file @
b1188e32
...
...
@@ -16,7 +16,7 @@ import (
"strings"
"time"
"github.com/hanwen/go-fuse/
fuse/
nodefs"
"github.com/hanwen/go-fuse/nodefs"
"github.com/hanwen/go-fuse/zipfs"
)
...
...
@@ -26,7 +26,7 @@ func main() {
profile
:=
flag
.
String
(
"profile"
,
""
,
"record cpu profile."
)
mem_profile
:=
flag
.
String
(
"mem-profile"
,
""
,
"record memory profile."
)
command
:=
flag
.
String
(
"run"
,
""
,
"run this command after mounting."
)
ttl
:=
flag
.
Float64
(
"ttl"
,
1.0
,
"attribute/entry cache TTL."
)
ttl
:=
flag
.
Duration
(
"ttl"
,
time
.
Second
,
"attribute/entry cache TTL."
)
flag
.
Parse
()
if
flag
.
NArg
()
<
2
{
fmt
.
Fprintf
(
os
.
Stderr
,
"usage: %s MOUNTPOINT ZIP-FILE
\n
"
,
os
.
Args
[
0
])
...
...
@@ -55,11 +55,12 @@ func main() {
}
opts
:=
&
nodefs
.
Options
{
AttrTimeout
:
time
.
Duration
(
*
ttl
*
float64
(
time
.
Second
))
,
EntryTimeout
:
time
.
Duration
(
*
ttl
*
float64
(
time
.
Second
))
,
De
bug
:
*
debug
,
AttrTimeout
:
ttl
,
EntryTimeout
:
ttl
,
De
faultPermissions
:
true
,
}
state
,
_
,
err
:=
nodefs
.
MountRoot
(
flag
.
Arg
(
0
),
root
,
opts
)
opts
.
Debug
=
*
debug
server
,
err
:=
nodefs
.
Mount
(
flag
.
Arg
(
0
),
root
,
opts
)
if
err
!=
nil
{
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
...
...
@@ -78,7 +79,7 @@ func main() {
cmd
.
Start
()
}
s
tate
.
Serve
()
s
erver
.
Wait
()
if
memProfFile
!=
nil
{
pprof
.
WriteHeapProfile
(
memProfFile
)
}
...
...
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