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

Mono.Unix.UnixFileSystemInfo.CreateLink Method

Creates a hard link so that UnixFileSystemInfo.FullName and path are the same file. [Edit]

public UnixFileSystemInfo CreateLink (string path)

See Also

Mono.Unix.Native.Syscall.link

Parameters

path
[Edit]

Returns

A Mono.Unix.UnixFileSystemInfo instance which represents path. [Edit]

Exceptions

TypeReason
InvalidOperationException

The file system containing UnixFileSystemInfo.FullName does not support hard links. [Mono.Unix.Native.Errno.EOPNOTSUPP]

-or-

The file UnixFileSystemInfo.FullName is a directory or is flagged immutable or append-only (see Mono.Unix.Native.Syscall.chflags). [Mono.Unix.Native.Errno.EPERM]

[Edit]
UnauthorizedAccessException

Search permission is denied for a component of the path UnixFileSystemInfo.FullName or path. [Mono.Unix.Native.Errno.EACCESS]

-or-

path requires writing in a directory with a mode that denies write permissions. [Mono.Unix.Native.Errno.EACCESS]

[Edit]
System.IO.DirectoryNotFoundException A component of the path prefix of UnixFileSystemInfo.FullName or path is not a directory. [Mono.Unix.Native.Errno.ENOTDIR] [Edit]
System.IO.FileNotFoundException

A component of UnixFileSystemInfo.FullName or path that must exist does not exist. [Mono.Unix.Native.Errno.ENOENT]

-or-

The file UnixFileSystemInfo.FullName does not exist. [Mono.Unix.Native.Errno.ENOENT]

[Edit]
System.IO.IOException

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

-or-

The directory for path cannot be extended because there is no space left. [Mono.Unix.Native.Errno.ENOSPC]

-or-

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

[Edit]
System.IO.PathTooLongExceptionUnixFileSystemInfo.FullName or path was too long. [Mono.Unix.Native.Errno.ENAMETOOLONG] [Edit]
Mono.Unix.UnixIOException

Too many symbolic links were encountered in translating UnixFileSystemInfo.FullName or path [Mono.Unix.Native.Errno.ELOOP]

-or-

UnixFileInfo.Directory cannot be extended because the user's quota of disk blocks on the file system containing this directory has been exhausted. [Mono.Unix.Native.Errno.EDQUOT]

-or-

UnixFileSystemInfo.LinkCount would exceed its limit. Use UnixFileSystemInfo.GetConfigurationValue(Mono.Unix.Native.PathconfName._PC_LINK_MAX) to determine the maximum link value. [Mono.Unix.Native.Errno.EMLINK]

-or-

path already exists. [Mono.Unix.Native.Errno.EEXIST]

-or-

UnixFileSystemInfo.FullName and path are on different file systems. [Mono.Unix.Native.Errno.EXDEV]

[Edit]

Remarks

The path argument is permitted to specify relative or absolute path information. Relative path information is interpreted as relative to the current working directory.

Note: To obtain the current working directory, see UnixDirectoryInfo.GetCurrentDirectory.

After creating the link, the link count UnixFileSystemInfo.LinkCount will be incremented, and there will be no way to distinguish the two files -- they're the same file with two (or more) different names.

[Edit]

Requirements

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