chown {unixtools}R Documentation

Change the ownership of files or other file system objects.

Description

chown attepts to change the user of group ownership of items specified by paths.

Usage

chown(paths, uid, gid = NA, follow.symlinks = TRUE)

Arguments

paths

a character vectors of paths to items (files, directories, ..) to change ownership of. path.expand is called implicitly before use.

uid

string specifying a username or numeric scalar specifying the uid or NA if the owning user is not to be changed.

gid

string specifying a groupname or numeric scalar specifying the gid or NA if the group is not to be changed. If uid is a username then gid can also be set to NULL in which case the gid is set to the primary group of the user.

follow.symlinks

if FALSE then only the ownership of the item specified by the path is changed. If TRUE and the target is a symlink then the ownership of the final target is changed, not the symlink itself.

Details

Typically, regular users can only change gid and only to a group of which they are a member. Only the superuser (root) can change the owner uid.

Both uid and gid cannot be NA, that is currently treated as an error.

Value

Logical vector of the same length as paths with TRUE for successful ownership change and FALSE if the action could not be performed on that item.

Author(s)

Simon Urbanek


[Package unixtools version 0.1-1 Index]