Skip to content

Commit 753b6dd

Browse files
Add Path.Lstat method
1 parent fa31eeb commit 753b6dd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

paths.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ func (p *Path) Stat() (os.FileInfo, error) {
7676
return os.Stat(p.path)
7777
}
7878

79+
// Lstat returns a FileInfo like stat, but when the path points to a
80+
// symlink, returns information about the symlink itself instead of the
81+
// target like Stat().
82+
func (p *Path) Lstat() (os.FileInfo, error) {
83+
return os.Lstat(p.path)
84+
}
85+
7986
// Clone create a copy of the Path object
8087
func (p *Path) Clone() *Path {
8188
return New(p.path)

0 commit comments

Comments
 (0)