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

Function getClashDir

agent/app/service/recycle_bin.go:200–218  ·  view source on GitHub ↗
(realPath string)

Source from the content-addressed store, hash-verified

198}
199
200func getClashDir(realPath string) (string, error) {
201 partitions, err := disk.Partitions(false)
202 if err != nil {
203 return "", err
204 }
205 for _, p := range partitions {
206 if p.Mountpoint == "/" {
207 continue
208 }
209 if strings.HasPrefix(realPath, p.Mountpoint) {
210 clashDir := path.Join(p.Mountpoint, recycleBinClashDir)
211 if err = createClashDir(clashDir); err != nil {
212 return "", err
213 }
214 return clashDir, nil
215 }
216 }
217 return global.Dir.RecycleBinDir, createClashDir(global.Dir.RecycleBinDir)
218}
219
220func createClashDir(clashDir string) error {
221 op := files.NewFileOp()

Callers 1

CreateMethod · 0.85

Calls 1

createClashDirFunction · 0.85

Tested by

no test coverage detected