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
ee7dc425
Commit
ee7dc425
authored
Mar 23, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Signal end-of-directory using channel close. Change callers.
parent
b68c22d2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
19 deletions
+17
-19
examplelib/multizip.go
examplelib/multizip.go
+1
-1
examplelib/zipfs.go
examplelib/zipfs.go
+1
-1
examplelib/zipfs_test.go
examplelib/zipfs_test.go
+7
-7
fuse/direntry.go
fuse/direntry.go
+2
-3
fuse/loopback.go
fuse/loopback.go
+1
-1
fuse/mount.go
fuse/mount.go
+5
-6
No files found.
examplelib/multizip.go
View file @
ee7dc425
...
...
@@ -124,7 +124,7 @@ func (me *MultiZipFs) OpenDir(name string) (stream chan fuse.DirEntry, code fuse
stream
<-
fuse
.
DirEntry
(
d
)
}
stream
<-
fuse
.
DirEntry
{
Name
:
""
}
close
(
stream
)
return
stream
,
fuse
.
OK
}
...
...
examplelib/zipfs.go
View file @
ee7dc425
...
...
@@ -167,7 +167,7 @@ func (me *ZipFileFuse) OpenDir(name string) (stream chan fuse.DirEntry, code fus
Mode
:
zip_DIRMODE
,
}
}
stream
<-
fuse
.
DirEntry
{}
close
(
stream
)
}()
return
stream
,
fuse
.
OK
}
...
...
examplelib/zipfs_test.go
View file @
ee7dc425
...
...
@@ -9,11 +9,11 @@ import (
func
TestZipFs
(
t
*
testing
.
T
)
{
wd
,
err
:=
os
.
Getwd
()
CheckSuccess
(
err
)
zfs
:=
NewZip
FileFuse
(
wd
+
"/test.zip"
)
zfs
:=
NewZip
ArchiveFileSystem
(
wd
+
"/test.zip"
)
connector
:=
fuse
.
NewPathFileSystemConnector
(
zfs
)
mountPoint
:=
fuse
.
MakeTempDir
()
state
:=
fuse
.
NewMountState
(
connector
)
state
.
Mount
(
mountPoint
)
...
...
@@ -21,12 +21,12 @@ func TestZipFs(t *testing.T) {
d
,
err
:=
os
.
Open
(
mountPoint
,
os
.
O_RDONLY
,
0
)
CheckSuccess
(
err
)
names
,
err
:=
d
.
Readdirnames
(
-
1
)
CheckSuccess
(
err
)
err
=
d
.
Close
()
CheckSuccess
(
err
)
if
len
(
names
)
!=
2
{
t
.
Error
(
"wrong length"
,
names
)
}
...
...
@@ -38,7 +38,7 @@ func TestZipFs(t *testing.T) {
fi
,
err
=
os
.
Stat
(
mountPoint
+
"/file.txt"
)
CheckSuccess
(
err
)
if
!
fi
.
IsRegular
()
{
t
.
Error
(
"file type"
,
fi
)
}
...
...
@@ -54,6 +54,6 @@ func TestZipFs(t *testing.T) {
t
.
Error
(
"content fail"
,
b
[
:
n
])
}
f
.
Close
()
state
.
Unmount
()
}
fuse/direntry.go
View file @
ee7dc425
...
...
@@ -99,9 +99,8 @@ func (me *FuseDir) ReadDir(input *ReadIn) (*DirEntryList, Status) {
}
for
{
d
:=
<-
me
.
stream
if
d
.
Name
==
""
{
close
(
me
.
stream
)
d
,
isOpen
:=
<-
me
.
stream
if
!
isOpen
{
me
.
stream
=
nil
break
}
...
...
fuse/loopback.go
View file @
ee7dc425
...
...
@@ -70,7 +70,7 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
break
}
}
output
<-
DirEntry
{}
close
(
output
)
f
.
Close
()
}()
...
...
fuse/mount.go
View file @
ee7dc425
...
...
@@ -52,9 +52,10 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
}
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
mountPoint
},
[]
string
{
"_FUSE_COMMFD=3"
},
""
,
[]
*
os
.
File
{
os
.
Stdin
,
os
.
Stdout
,
os
.
Stderr
,
remote
})
&
os
.
ProcAttr
{
Env
:
[]
string
{
"_FUSE_COMMFD=3"
},
Files
:
[]
*
os
.
File
{
os
.
Stdin
,
os
.
Stdout
,
os
.
Stderr
,
remote
}})
if
err
!=
nil
{
return
}
...
...
@@ -76,9 +77,7 @@ func unmount(mountPoint string) (err os.Error) {
dir
,
_
:=
filepath
.
Split
(
mountPoint
)
proc
,
err
:=
os
.
StartProcess
(
"/bin/fusermount"
,
[]
string
{
"/bin/fusermount"
,
"-u"
,
mountPoint
},
nil
,
dir
,
[]
*
os
.
File
{
nil
,
nil
,
os
.
Stderr
})
&
os
.
ProcAttr
{
Dir
:
dir
,
Files
:
[]
*
os
.
File
{
nil
,
nil
,
os
.
Stderr
}})
if
err
!=
nil
{
return
}
...
...
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