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
c32f2a18
Commit
c32f2a18
authored
Nov 24, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add memfs example binary.
parent
f4c835e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
0 deletions
+53
-0
example/memfs/Makefile
example/memfs/Makefile
+10
-0
example/memfs/main.go
example/memfs/main.go
+43
-0
No files found.
example/memfs/Makefile
0 → 100644
View file @
c32f2a18
# Use "gomake install" to build and install this package.
include
$(GOROOT)/src/Make.inc
TARG
=
memfs
GOFILES
=
main.go
DEPS
=
../../fuse
include
$(GOROOT)/src/Make.cmd
example/memfs/main.go
0 → 100644
View file @
c32f2a18
// Mounts MemNodeFs for testing purposes.
package
main
import
(
"flag"
"fmt"
"github.com/hanwen/go-fuse/fuse"
"log"
"os"
"runtime"
)
var
_
=
runtime
.
GOMAXPROCS
var
_
=
log
.
Print
func
main
()
{
// Scans the arg list and sets up flags
debug
:=
flag
.
Bool
(
"debug"
,
false
,
"print debugging messages."
)
flag
.
Parse
()
if
flag
.
NArg
()
<
2
{
// TODO - where to get program name?
fmt
.
Println
(
"usage: main MOUNTPOINT BACKING-PREFIX"
)
os
.
Exit
(
2
)
}
mountPoint
:=
flag
.
Arg
(
0
)
prefix
:=
flag
.
Arg
(
1
)
fs
:=
fuse
.
NewMemNodeFs
(
prefix
)
conn
:=
fuse
.
NewFileSystemConnector
(
fs
,
nil
)
state
:=
fuse
.
NewMountState
(
conn
)
state
.
Debug
=
*
debug
fmt
.
Println
(
"Mounting"
)
err
:=
state
.
Mount
(
mountPoint
,
nil
)
if
err
!=
nil
{
fmt
.
Printf
(
"Mount fail: %v
\n
"
,
err
)
os
.
Exit
(
1
)
}
fmt
.
Println
(
"Mounted!"
)
state
.
Loop
()
}
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