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
c3e96abe
Commit
c3e96abe
authored
Sep 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add -mem flag to unionfs example.
parent
3fed732a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
12 deletions
+19
-12
example/unionfs/main.go
example/unionfs/main.go
+19
-12
No files found.
example/unionfs/main.go
View file @
c3e96abe
...
@@ -11,29 +11,36 @@ import (
...
@@ -11,29 +11,36 @@ import (
func
main
()
{
func
main
()
{
debug
:=
flag
.
Bool
(
"debug"
,
false
,
"debug on"
)
debug
:=
flag
.
Bool
(
"debug"
,
false
,
"debug on"
)
mem
:=
flag
.
Bool
(
"mem"
,
false
,
"use in-memory unionfs"
)
delcache_ttl
:=
flag
.
Float64
(
"deletion_cache_ttl"
,
5.0
,
"Deletion cache TTL in seconds."
)
delcache_ttl
:=
flag
.
Float64
(
"deletion_cache_ttl"
,
5.0
,
"Deletion cache TTL in seconds."
)
branchcache_ttl
:=
flag
.
Float64
(
"branchcache_ttl"
,
5.0
,
"Branch cache TTL in seconds."
)
branchcache_ttl
:=
flag
.
Float64
(
"branchcache_ttl"
,
5.0
,
"Branch cache TTL in seconds."
)
deldirname
:=
flag
.
String
(
deldirname
:=
flag
.
String
(
"deletion_dirname"
,
"GOUNIONFS_DELETIONS"
,
"Directory name to use for deletions."
)
"deletion_dirname"
,
"GOUNIONFS_DELETIONS"
,
"Directory name to use for deletions."
)
flag
.
Parse
()
flag
.
Parse
()
if
len
(
flag
.
Args
())
<
2
{
if
len
(
flag
.
Args
())
<
2
{
fmt
.
Println
(
"Usage:
\n
main
MOUNTPOINT RW-DIRECTORY RO-DIRECTORY ..."
)
fmt
.
Println
(
"Usage:
\n
unionfs
MOUNTPOINT RW-DIRECTORY RO-DIRECTORY ..."
)
os
.
Exit
(
2
)
os
.
Exit
(
2
)
}
}
ufsOptions
:=
unionfs
.
UnionFsOptions
{
var
nodeFs
fuse
.
NodeFileSystem
DeletionCacheTTLSecs
:
*
delcache_ttl
,
if
*
mem
{
BranchCacheTTLSecs
:
*
branchcache_ttl
,
nodeFs
=
unionfs
.
NewMemUnionFs
(
DeletionDirName
:
*
deldirname
,
flag
.
Arg
(
1
)
+
"/"
,
&
fuse
.
LoopbackFileSystem
{
Root
:
flag
.
Arg
(
2
)})
}
}
else
{
ufsOptions
:=
unionfs
.
UnionFsOptions
{
DeletionCacheTTLSecs
:
*
delcache_ttl
,
BranchCacheTTLSecs
:
*
branchcache_ttl
,
DeletionDirName
:
*
deldirname
,
}
ufs
,
err
:=
unionfs
.
NewUnionFsFromRoots
(
flag
.
Args
()[
1
:
],
&
ufsOptions
,
true
)
ufs
,
err
:=
unionfs
.
NewUnionFsFromRoots
(
flag
.
Args
()[
1
:
],
&
ufsOptions
,
true
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Cannot create UnionFs"
,
err
)
log
.
Fatal
(
"Cannot create UnionFs"
,
err
)
os
.
Exit
(
1
)
os
.
Exit
(
1
)
}
nodeFs
=
fuse
.
NewPathNodeFs
(
ufs
,
&
fuse
.
PathNodeFsOptions
{
ClientInodes
:
true
})
}
}
mountState
,
_
,
err
:=
fuse
.
Mount
PathFileSystem
(
flag
.
Arg
(
0
),
uf
s
,
nil
)
mountState
,
_
,
err
:=
fuse
.
Mount
NodeFileSystem
(
flag
.
Arg
(
0
),
nodeF
s
,
nil
)
if
err
!=
nil
{
if
err
!=
nil
{
log
.
Fatal
(
"Mount fail:"
,
err
)
log
.
Fatal
(
"Mount fail:"
,
err
)
}
}
...
...
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