Instance Property


The path to the program’s current directory.


var currentDirectoryPath: String { get }


The current directory path is the starting point for any relative paths you specify. For example, if the current directory is /tmp and you specify a relative pathname of reports/info.txt, the resulting full path for the item is /tmp/reports/info.txt.

When an app is launched, this property is initially set to the app’s current working directory. If the current working directory is not accessible for any reason, the value of this property is nil. You can change the value of this property by calling the changeCurrentDirectoryPath(_:) method.

See Also

Managing the Current Directory

func changeCurrentDirectoryPath(String) -> Bool

Changes the path of the current working directory to the specified path.