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

Method BatchChangeModeAndOwner

agent/app/service/file.go:370–384  ·  view source on GitHub ↗
(op request.FileRoleReq)

Source from the content-addressed store, hash-verified

368}
369
370func (f *FileService) BatchChangeModeAndOwner(op request.FileRoleReq) error {
371 fo := files.NewFileOp()
372 for _, p := range op.Paths {
373 if !fo.Stat(p) {
374 return buserr.New("ErrPathNotFound")
375 }
376 }
377 if err := fo.ChownRPaths(op.Paths, op.User, op.Group, op.Sub); err != nil {
378 return err
379 }
380 if err := fo.ChmodRPaths(op.Paths, op.Mode, op.Sub); err != nil {
381 return err
382 }
383 return nil
384}
385
386func (f *FileService) collectPermanentDeleteTargets(targetPath string, isDir bool) ([]string, error) {
387 if !isDir {

Callers

nothing calls this directly

Calls 3

StatMethod · 0.95
ChownRPathsMethod · 0.95
ChmodRPathsMethod · 0.95

Tested by

no test coverage detected