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
7d4c2306
Commit
7d4c2306
authored
Oct 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement PathFs.LastNode() using FileSystemConnector.Node().
parent
04f7c3eb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
19 deletions
+4
-19
fuse/fsconnector.go
fuse/fsconnector.go
+3
-2
fuse/pathfs.go
fuse/pathfs.go
+1
-17
No files found.
fuse/fsconnector.go
View file @
7d4c2306
...
...
@@ -189,8 +189,9 @@ func (me *FileSystemConnector) Node(parent *Inode, fullPath string) (*Inode, []s
return
parent
,
nil
}
fullPath
=
strings
.
TrimLeft
(
filepath
.
Clean
(
fullPath
),
"/"
)
comps
:=
strings
.
Split
(
fullPath
,
"/"
)
sep
:=
string
(
filepath
.
Separator
)
fullPath
=
strings
.
TrimLeft
(
filepath
.
Clean
(
fullPath
),
sep
)
comps
:=
strings
.
Split
(
fullPath
,
sep
)
node
:=
parent
if
node
.
mountPoint
==
nil
{
...
...
fuse/pathfs.go
View file @
7d4c2306
...
...
@@ -5,7 +5,6 @@ import (
"log"
"os"
"path/filepath"
"strings"
"sync"
)
...
...
@@ -123,22 +122,7 @@ func (me *PathNodeFs) Path(node *Inode) string {
}
func
(
me
*
PathNodeFs
)
LastNode
(
name
string
)
(
*
Inode
,
[]
string
)
{
if
name
==
""
{
return
me
.
Root
()
.
Inode
(),
nil
}
name
=
filepath
.
Clean
(
name
)
comps
:=
strings
.
Split
(
name
,
string
(
filepath
.
Separator
))
node
:=
me
.
root
.
Inode
()
for
i
,
c
:=
range
comps
{
next
:=
node
.
GetChild
(
c
)
if
next
==
nil
{
return
node
,
comps
[
i
:
]
}
node
=
next
}
return
node
,
nil
return
me
.
connector
.
Node
(
me
.
Root
()
.
Inode
(),
name
)
}
func
(
me
*
PathNodeFs
)
FileNotify
(
path
string
,
off
int64
,
length
int64
)
Status
{
...
...
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