Table of Contents

19.3.1 Instructions CHOWN, CHMOD and CHGRP

As of Gambas 3.1, three new instructions are available to change the user/owner, group or permissions of a file.

19.3.1.1 CHOWN

The CHOWN (change owner) instruction changes the owner/proprietor of a file or directory:

CHOWN Path TO User

19.3.1.2 CHGRP

The CHGRP (change group) instruction changes the group membership of a file or directory:

CHGRP Path TO Group 

19.3.1.3 CHMOD

The CHMOD (change mode) instruction changes the permissions (mode) of a file or directory:

CHMOD Path TO Mode 

At http://gambaswiki.org/wiki/cat/mode or https://wiki.ubuntuusers.co.uk/rights you can read about the mode syntax. In addition, any omitted or unknown character in the mode string is ignored. In this way, you can change selected values of file permissions.

Example:

CHMOD sFilePath To "rwxrw-r--"

Download