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
40776fb9
Commit
40776fb9
authored
May 21, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix brown-paper-bag bug with MemNodeFs.
parent
7a509a55
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
fuse/memnode.go
fuse/memnode.go
+1
-1
fuse/memnode_test.go
fuse/memnode_test.go
+14
-0
No files found.
fuse/memnode.go
View file @
40776fb9
...
...
@@ -124,7 +124,7 @@ func (n *memNode) Create(name string, flags uint32, mode uint32, context *Contex
ch
:=
n
.
newNode
(
false
)
ch
.
info
.
Mode
=
mode
|
S_IFREG
f
,
err
:=
os
.
Create
(
n
.
filename
())
f
,
err
:=
os
.
Create
(
ch
.
filename
())
if
err
!=
nil
{
return
nil
,
nil
,
ToStatus
(
err
)
}
...
...
fuse/memnode_test.go
View file @
40776fb9
...
...
@@ -40,6 +40,20 @@ func setupMemNodeTest(t *testing.T) (wd string, fs *MemNodeFs, clean func()) {
}
func
TestMemNodeFsWrite
(
t
*
testing
.
T
)
{
wd
,
_
,
clean
:=
setupMemNodeTest
(
t
)
defer
clean
()
want
:=
"hello"
err
:=
ioutil
.
WriteFile
(
wd
+
"/test"
,
[]
byte
(
want
),
0644
)
CheckSuccess
(
err
)
content
,
err
:=
ioutil
.
ReadFile
(
wd
+
"/test"
)
if
string
(
content
)
!=
want
{
t
.
Fatalf
(
"content mismatch: got %q, want %q"
,
content
,
want
)
}
}
func
TestMemNodeFs
(
t
*
testing
.
T
)
{
wd
,
_
,
clean
:=
setupMemNodeTest
(
t
)
defer
clean
()
...
...
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