MCPcopy Index your code
hub / github.com/devspace-sh/devspace / IsRecursiveSymlink

Function IsRecursiveSymlink

pkg/util/fsutil/filesystem.go:15–25  ·  view source on GitHub ↗

IsRecursiveSymlink checks if the provided non-resolved file info is a recursive symlink

(f os.FileInfo, symlinkPath string)

Source from the content-addressed store, hash-verified

13// IsRecursiveSymlink checks if the provided non-resolved file info
14// is a recursive symlink
15func IsRecursiveSymlink(f os.FileInfo, symlinkPath string) bool {
16 // check if recursive symlink
17 if f.Mode()&os.ModeSymlink == os.ModeSymlink {
18 resolvedPath, err := filepath.EvalSymlinks(symlinkPath)
19 if err != nil || strings.HasPrefix(symlinkPath, filepath.ToSlash(resolvedPath)) {
20 return true
21 }
22 }
23
24 return false
25}
26
27// WriteToFile writes data to a file
28func WriteToFile(data []byte, filePath string) error {

Callers 8

recursiveTarFunction · 0.92
tarFolderMethod · 0.92
evaluateChangeMethod · 0.92
deleteSafeRecursiveMethod · 0.92
tarFolderFunction · 0.92
removeRecursiveMethod · 0.92
walkDirFunction · 0.92

Calls 1

ModeMethod · 0.45

Tested by

no test coverage detected