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
1b71459f
Commit
1b71459f
authored
Mar 16, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nodefs: add NewListDirStream()
parent
3e1c2619
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
18 deletions
+31
-18
nodefs/dirstream.go
nodefs/dirstream.go
+31
-0
nodefs/dirstream_darwin.go
nodefs/dirstream_darwin.go
+0
-18
No files found.
nodefs/dirstream.go
0 → 100644
View file @
1b71459f
// Copyright 2019 the Go-FUSE Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
nodefs
import
(
"github.com/hanwen/go-fuse/fuse"
)
type
dirArray
struct
{
entries
[]
fuse
.
DirEntry
}
func
(
a
*
dirArray
)
HasNext
()
bool
{
return
len
(
a
.
entries
)
>
0
}
func
(
a
*
dirArray
)
Next
()
(
fuse
.
DirEntry
,
fuse
.
Status
)
{
e
:=
a
.
entries
[
0
]
a
.
entries
=
a
.
entries
[
1
:
]
return
e
,
fuse
.
OK
}
func
(
a
*
dirArray
)
Close
()
{
}
func
NewListDirStream
(
list
[]
fuse
.
DirEntry
)
DirStream
{
return
&
dirArray
{
list
}
}
nodefs/dirstream_darwin.go
View file @
1b71459f
...
@@ -11,24 +11,6 @@ import (
...
@@ -11,24 +11,6 @@ import (
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse"
)
)
type
dirArray
struct
{
Entries
[]
fuse
.
DirEntry
}
func
(
a
*
dirArray
)
HasNext
()
bool
{
return
len
(
a
.
Entries
)
>
0
}
func
(
a
*
dirArray
)
Next
()
(
fuse
.
DirEntry
,
fuse
.
Status
)
{
e
:=
a
.
Entries
[
0
]
a
.
Entries
=
a
.
Entries
[
1
:
]
return
e
,
fuse
.
OK
}
func
(
a
*
dirArray
)
Close
()
{
}
func
NewLoopbackDirStream
(
nm
string
)
(
DirStream
,
fuse
.
Status
)
{
func
NewLoopbackDirStream
(
nm
string
)
(
DirStream
,
fuse
.
Status
)
{
f
,
err
:=
os
.
Open
(
nm
)
f
,
err
:=
os
.
Open
(
nm
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
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