-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to canonical Rio path and fix windows syscall reference
- Loading branch information
Showing
6 changed files
with
57 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package file | ||
|
||
import "os" | ||
|
||
type FileInfo struct { | ||
Nlink uint32 | ||
UID uint32 | ||
GID uint32 | ||
} | ||
|
||
// GetInfo extracts some non-standardized items from the result of a Stat call. | ||
func GetInfo(fi os.FileInfo) *FileInfo { | ||
return getInfo(fi) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris | ||
|
||
package file | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
) | ||
|
||
func getInfo(info os.FileInfo) *FileInfo { | ||
fi := &FileInfo{} | ||
if s, ok := info.Sys().(*syscall.Stat_t); ok { | ||
fi.Nlink = uint32(s.Nlink) | ||
fi.UID = s.Uid | ||
fi.GID = s.Gid | ||
return fi | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// +build windows | ||
|
||
package file | ||
|
||
import "os" | ||
|
||
func getInfo(info os.FileInfo) *FileInfo { | ||
// https://godoc.org/golang.org/x/sys/windows#GetFileInformationByHandle | ||
// can be potentially used to populate Nlink | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters