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
397fa2e1
Commit
397fa2e1
authored
May 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use os.FileInfo IsDirectory()/IsRegular.
parent
03784884
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
fuse/pathops.go
fuse/pathops.go
+1
-1
unionfs/unionfs.go
unionfs/unionfs.go
+3
-3
No files found.
fuse/pathops.go
View file @
397fa2e1
...
@@ -61,7 +61,7 @@ func (me *FileSystemConnector) internalLookupWithNode(parent *inode, name string
...
@@ -61,7 +61,7 @@ func (me *FileSystemConnector) internalLookupWithNode(parent *inode, name string
return
nil
,
err
,
nil
return
nil
,
err
,
nil
}
}
data
:=
me
.
lookupUpdate
(
parent
,
name
,
fi
.
Mode
&
S_IFDIR
!=
0
)
data
:=
me
.
lookupUpdate
(
parent
,
name
,
fi
.
IsDirectory
()
)
data
.
LookupCount
+=
lookupCount
data
.
LookupCount
+=
lookupCount
out
=
&
EntryOut
{
out
=
&
EntryOut
{
...
...
unionfs/unionfs.go
View file @
397fa2e1
...
@@ -256,7 +256,7 @@ func (me *UnionFs) Rmdir(path string) (code fuse.Status) {
...
@@ -256,7 +256,7 @@ func (me *UnionFs) Rmdir(path string) (code fuse.Status) {
if
r
.
code
!=
fuse
.
OK
{
if
r
.
code
!=
fuse
.
OK
{
return
r
.
code
return
r
.
code
}
}
if
r
.
attr
.
Mode
&
fuse
.
S_IFDIR
==
0
{
if
!
r
.
attr
.
IsDirectory
()
{
return
syscall
.
ENOTDIR
return
syscall
.
ENOTDIR
}
}
if
r
.
branch
>
0
{
if
r
.
branch
>
0
{
...
@@ -450,7 +450,7 @@ func (me *UnionFs) Readlink(name string) (out string, code fuse.Status) {
...
@@ -450,7 +450,7 @@ func (me *UnionFs) Readlink(name string) (out string, code fuse.Status) {
func
IsDir
(
fs
fuse
.
FileSystem
,
name
string
)
bool
{
func
IsDir
(
fs
fuse
.
FileSystem
,
name
string
)
bool
{
a
,
code
:=
fs
.
GetAttr
(
name
)
a
,
code
:=
fs
.
GetAttr
(
name
)
return
code
.
Ok
()
&&
a
.
Mode
&
fuse
.
S_IFDIR
!=
0
return
code
.
Ok
()
&&
a
.
IsDirectory
()
}
}
func
stripSlash
(
fn
string
)
string
{
func
stripSlash
(
fn
string
)
string
{
...
@@ -469,7 +469,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
...
@@ -469,7 +469,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
if
r
.
code
!=
fuse
.
OK
{
if
r
.
code
!=
fuse
.
OK
{
log
.
Println
(
"path component does not exist"
,
filename
,
dirName
)
log
.
Println
(
"path component does not exist"
,
filename
,
dirName
)
}
}
if
r
.
attr
.
Mode
&
fuse
.
S_IFDIR
==
0
{
if
!
r
.
attr
.
IsDirectory
()
{
log
.
Println
(
"path component is not a directory."
,
dirName
,
r
)
log
.
Println
(
"path component is not a directory."
,
dirName
,
r
)
return
fuse
.
EPERM
return
fuse
.
EPERM
}
}
...
...
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