MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / checkSymlink

Method checkSymlink

agent/utils/files/fileinfo.go:467–482  ·  view source on GitHub ↗
(df FileSearchInfo)

Source from the content-addressed store, hash-verified

465}
466
467func (f *FileInfo) checkSymlink(df FileSearchInfo) (bool, bool) {
468 isSymlink := false
469 isInvalidLink := false
470
471 if IsSymlink(df.Mode()) {
472 isSymlink = true
473 info, err := f.Fs.Stat(path.Join(df.Path, df.Name()))
474 if err == nil {
475 df.FileInfo = info
476 } else {
477 isInvalidLink = true
478 }
479 }
480
481 return isSymlink, isInvalidLink
482}
483
484func (f *FileInfo) getContent() error {
485 if IsBlockDevice(f.FileMode) {

Callers 1

processFilesMethod · 0.95

Calls 4

IsSymlinkFunction · 0.85
ModeMethod · 0.80
NameMethod · 0.65
StatMethod · 0.45

Tested by

no test coverage detected