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
5c0109c6
Commit
5c0109c6
authored
May 23, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle new readdir() behavior of 22/05 release of Go.
parent
d33686e1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
9 deletions
+21
-9
fuse/loopback.go
fuse/loopback.go
+2
-2
fuse/loopback_test.go
fuse/loopback_test.go
+19
-7
No files found.
fuse/loopback.go
View file @
5c0109c6
...
...
@@ -59,11 +59,11 @@ func (me *LoopbackFileSystem) OpenDir(name string) (stream chan DirEntry, status
Mode
:
infos
[
i
]
.
Mode
,
}
}
if
len
(
infos
)
<
want
{
if
len
(
infos
)
<
want
||
err
==
os
.
EOF
{
break
}
if
err
!=
nil
{
// TODO - how to signal error
log
.
Println
(
"Readdir() returned err:"
,
err
)
break
}
}
...
...
fuse/loopback_test.go
View file @
5c0109c6
...
...
@@ -533,16 +533,17 @@ func (me *testCase) testLargeDirRead() {
dir
,
err
:=
os
.
Open
(
filepath
.
Join
(
me
.
mountPoint
,
"readdirSubdir"
))
CheckSuccess
(
err
)
defer
dir
.
Close
()
// Chunked read.
total
:=
0
readSet
:=
make
(
map
[
string
]
bool
)
for
{
namesRead
,
err
:=
dir
.
Readdirnames
(
200
)
CheckSuccess
(
err
)
if
len
(
namesRead
)
==
0
{
if
len
(
namesRead
)
==
0
||
err
==
os
.
EOF
{
break
}
CheckSuccess
(
err
)
for
_
,
v
:=
range
namesRead
{
readSet
[
v
]
=
true
}
...
...
@@ -558,9 +559,6 @@ func (me *testCase) testLargeDirRead() {
me
.
tester
.
Errorf
(
"Name %v not found in output"
,
k
)
}
}
dir
.
Close
()
os
.
RemoveAll
(
subdir
)
}
...
...
@@ -581,9 +579,23 @@ func TestMount(t *testing.T) {
ts
.
testAccess
()
ts
.
testMknod
()
ts
.
testFSync
()
ts
.
testTouch
()
}
func
TestLargeRead
(
t
*
testing
.
T
)
{
ts
:=
new
(
testCase
)
ts
.
Setup
(
t
)
defer
ts
.
Cleanup
()
ts
.
testLargeRead
()
}
func
TestLargeDirRead
(
t
*
testing
.
T
)
{
ts
:=
new
(
testCase
)
ts
.
Setup
(
t
)
defer
ts
.
Cleanup
()
ts
.
testLargeDirRead
()
ts
.
testTouch
()
}
func
TestDelRename
(
t
*
testing
.
T
)
{
...
...
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