User Tools

Site Tools


k19:k19.3:k19.3.1:start

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
  • Path is the file or directory path,
  • User is the name of the new owner/proprietor.

19.3.1.2 CHGRP

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

CHGRP Path TO Group 
  • Path is the file or directory path,
  • Group is the name of the new group.

19.3.1.3 CHMOD

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

CHMOD Path TO Mode 
  • Path is the file or directory path,
  • Mode is a string of nine characters describing the new 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

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k19/k19.3/k19.3.1/start.txt · Last modified: 13.10.2023 by emma

Page Tools