Mono.Unix.UnixDirectoryInfo.SetCurrentDirectory Method
Sets the application's current working directory to the specified directory.

Syntax

public static void SetCurrentDirectory (string path)

See Also

Mono.Unix.Native.Syscall.chdir

Parameters

path
A string containing the path to which the current working directory is set.

Exceptions

TypeReason
UnauthorizedAccessException The process cannot access path. [Mono.Unix.Native.Errno.EACCESS]
System.IO.DirectoryNotFoundException A component of path is not a directory. [Mono.Unix.Native.Errno.ENOTDIR]
System.IO.FileNotFoundException path does not exist. [Mono.Unix.Native.Errno.ENOENT]
System.IO.PathTooLongException path is too long. [Mono.Unix.Native.Errno.ENAMETOOLONG]
System.IO.IOException An I/O error occurred. [Mono.Unix.Native.Errno.EIO]
Mono.Unix.UnixIOException Too many symbolic links were encountered in resolving path. [Mono.Unix.Native.Errno.ELOOP]

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.

Requirements

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