0

I wanna get current working dir, in order to call some commands. I copied code from jetpack compose desktop lib's demo, but got wrong dir("/"). Could any one tell me what's the problem? thank you.

(jetpack compose desktop lib: https://github.com/JetBrains/compose-jb/blob/master/tutorials/Native_distributions_and_local_execution/README.md)

                        val userDirStr = File(System.getProperty("user.dir"))
                        if (userDirStr != null) {
                            println("Row, onGloballyPositioned, userDirStr = " + userDirStr)
                            outputText = "directory = " + userDirStr
                        }
thecr0w
  • 2,148
  • 4
  • 33
  • 59

1 Answers1

1

I build a new Compose Crossplatform project, and copy old code into it. Then "File(System.getProperty("compose.application.resources.dir"))" just got the right path.

thecr0w
  • 2,148
  • 4
  • 33
  • 59