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
b248a511
Commit
b248a511
authored
Jul 07, 2013
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse: remove unused type FileMode
parent
bf2c65fb
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
58 deletions
+0
-58
fuse/attr.go
fuse/attr.go
+0
-45
fuse/attr_test.go
fuse/attr_test.go
+0
-13
No files found.
fuse/attr.go
View file @
b248a511
package
fuse
import
(
"log"
"os"
"syscall"
"time"
)
type
FileMode
uint32
func
(
me
FileMode
)
String
()
string
{
switch
uint32
(
me
)
&
syscall
.
S_IFMT
{
case
syscall
.
S_IFIFO
:
return
"p"
case
syscall
.
S_IFCHR
:
return
"c"
case
syscall
.
S_IFDIR
:
return
"d"
case
syscall
.
S_IFBLK
:
return
"b"
case
syscall
.
S_IFREG
:
return
"f"
case
syscall
.
S_IFLNK
:
return
"l"
case
syscall
.
S_IFSOCK
:
return
"s"
default
:
log
.
Panic
(
"Unknown mode: %o"
,
me
)
}
return
"0"
}
func
(
m
FileMode
)
IsFifo
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFIFO
}
// IsChar reports whether the FileInfo describes a character special file.
func
(
m
FileMode
)
IsChar
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFCHR
}
// IsDir reports whether the FileInfo describes a directory.
func
(
m
FileMode
)
IsDir
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFDIR
}
// IsBlock reports whether the FileInfo describes a block special file.
func
(
m
FileMode
)
IsBlock
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFBLK
}
// IsRegular reports whether the FileInfo describes a regular file.
func
(
m
FileMode
)
IsRegular
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFREG
}
// IsSymlink reports whether the FileInfo describes a symbolic link.
func
(
m
FileMode
)
IsSymlink
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFLNK
}
// IsSocket reports whether the FileInfo describes a socket.
func
(
m
FileMode
)
IsSocket
()
bool
{
return
(
uint32
(
m
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFSOCK
}
func
(
a
*
Attr
)
IsFifo
()
bool
{
return
(
uint32
(
a
.
Mode
)
&
syscall
.
S_IFMT
)
==
syscall
.
S_IFIFO
}
// IsChar reports whether the FileInfo describes a character special file.
...
...
fuse/attr_test.go
deleted
100644 → 0
View file @
bf2c65fb
package
fuse
import
(
"syscall"
"testing"
)
func
TestFileMode
(
t
*
testing
.
T
)
{
sock
:=
FileMode
(
syscall
.
S_IFSOCK
)
if
sock
.
IsDir
()
{
t
.
Error
(
"Socket should not be directory"
)
}
}
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