-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from tryggvil/master
Implementing default getOSFileInfo implementation
- Loading branch information
Showing
4 changed files
with
40 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build !windows && !darwin && !dragonfly && !freebsd && !linux && !nacl && !netbsd && !openbsd && !solaris && !wasm | ||
|
||
package file | ||
|
||
import ( | ||
"os" | ||
) | ||
|
||
func getOSFileInfo(_ os.FileInfo) *FileInfo { | ||
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,20 @@ | ||
//go:build wasm | ||
|
||
package file | ||
|
||
import ( | ||
"os" | ||
"syscall" | ||
) | ||
|
||
func getOSFileInfo(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 | ||
fi.Fileid = s.Ino | ||
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
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