HomeManualTopicsTypesSymbols

std::chown

changes the owner and group of the specified file

Parameters

filename
the name of the file for which to change the owner and group
owner_id
the ID of the new owner
group_id
the ID of the new group

Results

None

Description

This function needs I/O-access rights.

Example

# change the owner and group of a file getuid $my_uid getgid $my_gid chown! "myfile.txt" my_uid my_gid

Topic

POSIX

See also

std::chmod changes the mode of the specified file
std_types::user_id a POSIX user id
std_types::group_id a POSIX group ID