github.com/haraldrudell/parl@v0.4.176/pfs/stat.go (about)

     1  /*
     2  © 2021–present Harald Rudell <harald.rudell@gmail.com> (https://haraldrudell.github.io/haraldrudell/)
     3  ISC License
     4  */
     5  
     6  package pfs
     7  
     8  import (
     9  	"io/fs"
    10  	"os"
    11  
    12  	"github.com/haraldrudell/parl/perrors"
    13  )
    14  
    15  func Stat(path string) (fileInfo fs.FileInfo, err error) {
    16  	if fileInfo, err = os.Stat(path); err != nil {
    17  		err = perrors.Errorf("os.Stat: ‘%w’", err)
    18  	}
    19  	return
    20  }