I'm using chicagoboss for web development. To test some test modules I would like to change my current directory to something else. I know I can change directory by specifying full path to to cd("full path"). Suppose I'm in a directory "/home/user/workspace/myproject/myapp/" where I'm running myproject project.But now I want to check my current location using erlang shell.

Is there any function/command in erlang to get current working directory? In python I was using os.getcwd().

有帮助吗?

解决方案

Try:

{ok, CurrentDirectory} = file:get_cwd().

Also check out erldocs.com to quickly look up functions in the Erlang documentation.

其他提示

Use the command:

pwd().

More text to get to the Stackoverflow minimum

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top