isExecutable

Checks if the file located by this path exists and is executable.

inline fun Path.isExecutable(): Boolean(source)
import java.nio.file.Paths
import kotlin.io.path.isExecutable

fun main() {
    val path = Paths.get("script.sh")   // Path to the file you want to check
    if (path.isExecutable()) {
        println("$path is executable.")
    } else {
        println("$path is not executable.")
    }
}

Source