20.12 Setting file owner and group

Function: mbfl_file_enable_owner_and_group

Declare the intention to use the programs required to change file owner and group. Declaring the intention to use a program

The programs are: chown, chgrp, stat.

To change the file owner and group one may request the use of sudo: just request a user before invoking the following function. Executing a program

Function: mbfl_file_set_owner OWNER PATHNAME OPT

Change the file owner for PATHNAME; OWNER must be in a form accepted by chown. The optional arguments OPT are handed to chown as options.

Function: mbfl_file_set_group GROUP PATHNAME OPT

Change the file group for PATHNAME; GROUP must be in a form accepted by chgrp. The optional arguments OPT are handed to chgrp as options.

Function: mbfl_file_get_owner PATHNAME
Function: mbfl_file_get_owner_var _RV PATHNAME

Print the owner of the file as symbolic name.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.

Function: mbfl_file_get_group PATHNAME
Function: mbfl_file_get_group_var _RV PATHNAME

Print the group of the file as symbolic name.

The function variant _var stores the result in the variable _RV, rather than print it; Result variables.

Function: mbfl_exec_chown ARG

Execute the program chown using the given optional arguments.

Function: mbfl_exec_chgrp PATHNAME OPT

Execute the program chgrp using the given optional arguments.


This document describes version 3.0.0-devel.9 of Marcos Bash Functions Library.