# 22. Virtuoso Functions Guide - os_chown

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
file_delete
file_dirlist
file_mkdir
file_mkpath
file_stat
file_to_string
file_to_string_outpu...
file_unlink
os_chmod
os_chown
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## os_chown

changes the owning group/user of a file
os_chown (in path varchar, in username varchar, in groupname varchar);
Parameters
path – varchar relative path.
username – varchar the name of the OS user to own the file.
groupname – varchar the name of the OS group to own the file.
Description

This function requires dba privileges.

os_chown set the owning user/group of an OS file by calling the system function chown() with the arguments supplied.

Not all the host OSes support the concept of owner users and groups. That's why the function will not throw an SQL error if it fails.

It will return DB NULL value when the function was executed succsessfully and the error message as a string if it failed.

The function first looks up the user and group name supplied into the OS database to get the user and group IDs. it then calls the system function chown().

The DirsAllowed and DirsDenied lists in Parameters section of the virtuoso configuration file (virtuoso.ini by default) are used to control disk access.

Examples
Simple example

Sets the ownership of the virtuoso INI file to virtuoso user and group

    SQL>select os_chown (virtuoso_ini_path(), 'virtuoso', 'virtuoso');
    callret
    VARCHAR
    _______________________________________________________________________________

    NULL

See Also

file_delete

file_stat

os_chown

virtuoso_ini_path