(dst string, mode fs.FileMode, sub bool)
| 274 | } |
| 275 | |
| 276 | func (f FileOp) ChmodRWithMode(dst string, mode fs.FileMode, sub bool) error { |
| 277 | args := []string{fmt.Sprintf("%o", mode.Perm()), dst} |
| 278 | if sub { |
| 279 | args = append([]string{"-R", fmt.Sprintf("%o", mode.Perm())}, dst) |
| 280 | } |
| 281 | timeout := cmdDefaultTimeout |
| 282 | if sub { |
| 283 | timeout = cmdRecursiveTimeout |
| 284 | } |
| 285 | cmdMgr := cmd.NewCommandMgr(cmd.WithTimeout(timeout)) |
| 286 | if err := cmdMgr.RunWithOptionalSudo("chmod", args...); err != nil { |
| 287 | return err |
| 288 | } |
| 289 | return nil |
| 290 | } |
| 291 | |
| 292 | func (f FileOp) ChownRPaths(paths []string, uid string, gid string, sub bool) error { |
| 293 | if len(paths) == 0 { |
no test coverage detected