2014-11-13 15:00:04 -05:00
|
|
|
// +build !windows
|
|
|
|
|
|
|
|
package system
|
|
|
|
|
|
|
|
import (
|
|
|
|
"syscall"
|
|
|
|
)
|
|
|
|
|
2015-03-31 04:03:31 -04:00
|
|
|
// Lstat takes a path to a file and returns
|
|
|
|
// a system.Stat_t type pertaining to that file.
|
|
|
|
//
|
|
|
|
// Throws an error if the file does not exist
|
2015-03-11 11:42:49 -04:00
|
|
|
func Lstat(path string) (*Stat_t, error) {
|
2014-11-13 15:00:04 -05:00
|
|
|
s := &syscall.Stat_t{}
|
2015-04-26 12:50:25 -04:00
|
|
|
if err := syscall.Lstat(path, s); err != nil {
|
2014-11-13 15:00:04 -05:00
|
|
|
return nil, err
|
|
|
|
}
|
2014-11-13 15:36:05 -05:00
|
|
|
return fromStatT(s)
|
2014-11-13 15:00:04 -05:00
|
|
|
}
|