Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jacobsa-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
jacobsa-fuse
Commits
850146a6
Commit
850146a6
authored
Jan 11, 2016
by
Aaron Jacobs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add GetTimes, implemented for darwin.
parent
895b8c41
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
fusetesting/stat.go
fusetesting/stat.go
+7
-0
fusetesting/stat_darwin.go
fusetesting/stat_darwin.go
+7
-0
No files found.
fusetesting/stat.go
View file @
850146a6
...
...
@@ -18,6 +18,7 @@ import (
"fmt"
"os"
"reflect"
"syscall"
"time"
"github.com/jacobsa/oglematchers"
...
...
@@ -95,6 +96,12 @@ func birthtimeIsWithin(
return
nil
}
// Extract time information from the supplied file info. Panic on platforms
// where this is not possible.
func
GetTimes
(
fi
os
.
FileInfo
)
(
atime
,
ctime
,
mtime
time
.
Time
)
{
return
getTimes
(
fi
.
Sys
()
.
(
*
syscall
.
Stat_t
))
}
// Match os.FileInfo values that specify a number of links equal to the given
// number. On platforms where there is no nlink field available, match all
// os.FileInfo values.
...
...
fusetesting/stat_darwin.go
View file @
850146a6
...
...
@@ -36,3 +36,10 @@ func extractNlink(sys interface{}) (nlink uint64, ok bool) {
ok
=
true
return
}
func
getTimes
(
stat
*
syscall
.
Stat_t
)
(
atime
,
ctime
,
mtime
time
.
Time
)
{
atime
=
time
.
Unix
(
stat
.
Atimespec
.
Unix
())
ctime
=
time
.
Unix
(
stat
.
Ctimespec
.
Unix
())
mtime
=
time
.
Unix
(
stat
.
Mtimespec
.
Unix
())
return
}
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