chown function Null safety

void chown(
  1. String path,
  2. {String? user,
  3. String? group,
  4. bool recursive = true}
)

Sets the owner of a file on posix systems.

Changes the user or group ownership of path.

On Windows this command has no effect.

path is the path to the file or directory that we are changing the ownership of. If path does not exists then a ChOwnException is thrown. path may be absolute (preferred) or relative.

user is the posix user that will own the file/directory. If no user is specified then the loggedin user is used.

group is the posix group that will own the file/directory. If no group is specified then user is used as the group name.

If recursive is true (the default) then the change is applied to all subdirectories. If you pass recursive and path is a file then recursive will be ignored.

Implementation

void chown(String path, {String? user, String? group, bool recursive = true}) =>
    _ChOwn()._chown(path, user: user, group: group, recursive: recursive);