Expand description
Recursive permission/ownership changes (chmod/chgrp/chown) over a fileset.
The public entry point is chmod; it mirrors crate::rm() but transforms
metadata in place (from a per-type rule) instead of removing entries.
Structs§
- Mode
Program - Per-type mode rules. Symlinks are never included (mode bits aren’t settable on Linux symlinks).
- Owner
Program - Which user/group id (if any) to apply to each entry type.
Noneleaves that type unchanged for this operation. - Settings
- Configuration for a recursive chmod/chgrp/chown run.
- Summary
- Symbolic
Clause - One
[ugoa][+-=][rwxXst]clause.who/permsare bitmasks (seeWHO_*/PERM_*).
Enums§
- IdKind
- Whether a DSL id token refers to a user or group.
- ModeOp
- The operator in a symbolic mode clause: add, remove, or set permissions.
- Mode
Spec - A parsed
chmodmode expression: either a symbolic program (applied relative to the current mode) or an absolute octal value (12-bit).
Functions§
- apply_
mode - Apply a mode spec to a current 12-bit mode, returning the new 12-bit mode.
is_dirdrives the conditionalXpermission. - chmod
- Public entry point. Applies metadata changes to
pathand, recursively, its contents. Mirrorscrate::rm::rmfor the root-filter check. - parse_
mode_ dsl - Parse a
--modeDSL string. A bare token is the default for files+dirs;f:/d:sections override per type.l:is rejected (symlink mode bits are not settable on Linux). - parse_
owner_ dsl - Parse a
--group/--ownerDSL string. A bare token is the default for all types;f:/d:/l:sections override per type.
Type Aliases§
- Error
- Error type for chmod operations. See
crate::error::OperationError.