gitlab.com/evatix-go/core@v1.3.55/chmodhelper/GetExistingChmod.go (about) 1 package chmodhelper 2 3 import ( 4 "os" 5 6 "gitlab.com/evatix-go/core/errcore" 7 ) 8 9 func GetExistingChmod(filePath string) (os.FileMode, error) { 10 fileInfo, err := os.Stat(filePath) 11 12 if err != nil || fileInfo == nil { 13 return 0, errcore. 14 PathErrorType. 15 Error(err.Error(), ", file:"+filePath) 16 } 17 18 return fileInfo.Mode(), err 19 }