Mono Class Library: Mono.Unix.UnixStream Overview | Members

Mono.Unix.UnixStream.SetOwner Method

Set the owner user ID and owner group ID of UnixStream.Handle.

public void SetOwner (string user, string group)

See Also

UnixUserInfo
UnixGroupInfo
Mono.Unix.Native.Syscall.chown

Parameters

user
A string containing the user name of the owner user id to use.
group
A string containing the group name of the owner group id to use.

Exceptions

TypeReason
InvalidOperationException The effective user ID does not match the owner of the file and the effective user ID is not the super-user. [Mono.Unix.Native.Errno.EPERM]
ObjectDisposedException The stream has been closed.
System.IO.FileNotFoundException A component of UnixStream.Handle that must exist does not exist. [Mono.Unix.Native.Errno.ENOENT]
System.IO.IOException

UnixStream.Handle resides on a read-only file system. [Mono.Unix.Native.Errno.EROFS]

-or-

An I/O error occurred while making the directory entry or allocating the inode. [Mono.Unix.Native.Errno.EIO]

Remarks

If this is called by the non-super user (usually the root user), then the FileSpecialAttributes.SetUserId and FileSpecialAttributes.SetGroupId bits are cleared.

Requirements

Namespace: Mono.Unix
Assembly: Mono.Posix (in Mono.Posix.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0