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
0c055e17
Commit
0c055e17
authored
Oct 26, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add OsFileInfo and OsFileInfos for easy printing.
parent
50ab9a69
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
fuse/typeprint.go
fuse/typeprint.go
+34
-0
No files found.
fuse/typeprint.go
View file @
0c055e17
...
...
@@ -3,6 +3,7 @@ package fuse
import
(
"fmt"
"os"
"sort"
"strings"
"syscall"
)
...
...
@@ -90,6 +91,39 @@ func (me *OpenIn) String() string {
return
fmt
.
Sprintf
(
"{%s}"
,
flagString
(
openFlagNames
,
int
(
me
.
Flags
),
"O_RDONLY"
))
}
type
OsFileInfo
os
.
FileInfo
func
(
me
OsFileInfo
)
String
()
string
{
return
fmt
.
Sprintf
(
"{%s M0%o S=%d L=%d "
+
"%d:%d "
+
"%d*%d %d:%d "
+
"C %d.%09d "
+
"M %d.%09d "
+
"A %d.%09d}"
,
me
.
Name
,
me
.
Mode
,
me
.
Size
,
me
.
Nlink
,
me
.
Uid
,
me
.
Gid
,
me
.
Blocks
,
me
.
Blksize
,
me
.
Rdev
,
me
.
Ino
,
me
.
Ctime_ns
/
1e9
,
me
.
Ctime_ns
%
1e9
,
me
.
Mtime_ns
/
1e9
,
me
.
Mtime_ns
%
1e9
,
me
.
Atime_ns
/
1e9
,
me
.
Atime_ns
%
1e9
)
}
type
OsFileInfos
[]
*
os
.
FileInfo
func
(
me
OsFileInfos
)
String
()
string
{
out
:=
[]
string
{}
for
_
,
info
:=
range
me
{
out
=
append
(
out
,
OsFileInfo
(
*
info
)
.
String
())
}
sort
.
Strings
(
out
)
return
fmt
.
Sprintf
(
"[%v]"
,
out
)
}
func
(
me
*
SetAttrIn
)
String
()
string
{
s
:=
[]
string
{}
if
me
.
Valid
&
FATTR_MODE
!=
0
{
...
...
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