all: Adjust windows perms in fs package (#5200)
This commit is contained in:
@@ -10,7 +10,6 @@ package osutil
|
||||
import (
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -136,24 +135,6 @@ func copyFileContents(filesystem fs.Filesystem, src, dst string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
var execExts map[string]bool
|
||||
|
||||
func init() {
|
||||
// PATHEXT contains a list of executable file extensions, on Windows
|
||||
pathext := filepath.SplitList(os.Getenv("PATHEXT"))
|
||||
// We want the extensions in execExts to be lower case
|
||||
execExts = make(map[string]bool, len(pathext))
|
||||
for _, ext := range pathext {
|
||||
execExts[strings.ToLower(ext)] = true
|
||||
}
|
||||
}
|
||||
|
||||
// IsWindowsExecutable returns true if the given path has an extension that is
|
||||
// in the list of executable extensions.
|
||||
func IsWindowsExecutable(path string) bool {
|
||||
return execExts[strings.ToLower(filepath.Ext(path))]
|
||||
}
|
||||
|
||||
func IsDeleted(ffs fs.Filesystem, name string) bool {
|
||||
if _, err := ffs.Lstat(name); fs.IsNotExist(err) {
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user