Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the current working directory in Kotlin?

I need to know the full path of my current working directory of my simple application using Kotlin.

like image 529
Anisuzzaman Babla Avatar asked Oct 02 '20 11:10

Anisuzzaman Babla


Video Answer


1 Answers

This will provide the full absolute path from where application will run.

import java.nio.file.Paths

val path = Paths.get("").toAbsolutePath().toString()       
like image 88
Anisuzzaman Babla Avatar answered Oct 07 '22 13:10

Anisuzzaman Babla