Gary Sieling

Get current directory in scala

This just uses one of the Java utilities to get the current directory (this property is where Java was run from).

def pwd = System.getProperty("user.dir")

Example:

scala> println(pwd)
D:\Program Files (x86)\Git
Exit mobile version