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 (long user, long group)

See Also

Mono.Unix.Native.Syscall.chown

Parameters

user
A long containing the user id of the new owner user. If -1, the owner user id is unchanged.
group
A long containing the group id of the new owner group. If -1, the owner group id is unchanged.

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