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

Method BatchCheckFiles

agent/app/service/file.go:1165–1179  ·  view source on GitHub ↗
(req request.FilePathsCheck)

Source from the content-addressed store, hash-verified

1163}
1164
1165func (f *FileService) BatchCheckFiles(req request.FilePathsCheck) []response.ExistFileInfo {
1166 fileList := make([]response.ExistFileInfo, 0, len(req.Paths))
1167 for _, filePath := range req.Paths {
1168 if info, err := os.Stat(filePath); err == nil {
1169 fileList = append(fileList, response.ExistFileInfo{
1170 Size: info.Size(),
1171 Name: info.Name(),
1172 Path: filePath,
1173 ModTime: info.ModTime(),
1174 IsDir: info.IsDir(),
1175 })
1176 }
1177 }
1178 return fileList
1179}
1180
1181func (f *FileService) GetHostMount() []dto.DiskInfo {
1182 return loadDiskInfo()

Callers

nothing calls this directly

Calls 5

ModTimeMethod · 0.80
IsDirMethod · 0.80
SizeMethod · 0.65
NameMethod · 0.65
StatMethod · 0.45

Tested by

no test coverage detected