willflier
03/14/2023, 11:20 AM_NSGetExecutablePath()
function in K/N macos target.Landry Norris
03/14/2023, 1:24 PMwillflier
03/14/2023, 1:47 PMactual val executablePath: String = memScoped {
val buff = allocArray<ByteVar>(pathBufferSize)
val pid = getpid()
val ret = proc_pidpath(pid, buff, pathBufferSize.toUInt())
if(ret < 0) {
perror("Error getting pidpath")
return@memScoped ""
}
buff.toKStringFromUtf8()
}
willflier
03/14/2023, 1:48 PM