chgrp: Change a file's group on a Unix-like system

Description Usage Arguments Value Possible Errors See Also Examples

Description

This wraps a call to the unix-based chgrp system command. It validates input for the group= and filename= arguments, so it should be safe to process user values for these arguments

Usage

1

Arguments

group

The new group name for the file or directory.

file

The file or directory getting a new group. Must exist.

Value

The old group name of the file or directory, silently.

Possible Errors

"No such file: <file>"

The specified file= argument must exist.

"No such group: <group> in <group1>, <group2>, ..."

The specified group= argument must be one of the allowed groups for the user as returned by groups.

"Can't change group to '<group>'. Error was: ..."

If changing the group fails, the resulting error is reported. E.g. if you don't have permission to change the group of the file or directory.

"System command failed with status <status> Command was: chgrp <group> <file> The system-level error message (if any) was: ..."

Some failures may not be caught or reported cleanly. This is a last- ditch effort to provide information on such failures.

"chgrp() is only implemented for unix systems"

Will die with error if .Platform$OS.type != 'unix'.

See Also

groups

Examples

1
2
3
4
## Not run: 
chgrp( aGroup, someFile )

## End(Not run)

jefferys/DataRepo documentation built on May 19, 2019, 3:58 a.m.