Thread
#stdlib
    c

    cedric

    5 years ago
    @orangy The following code throws, is this the expected behavior? It looks like
    copyRecursively
    is changing the target from a directory to a file:
    fun main(args: Array<String>) {
        val from = File("/tmp/foo").apply { writeText("I'm a file") }
        val to = File("/tmp/to").apply {
            deleteRecursively()
            mkdirs()
        }
        from.copyRecursively(to, overwrite = true)
        if (! to.isDirectory) {
            throw AssertionError("Should be a directory")
        }
    }
    orangy

    orangy

    5 years ago
    I don’t have any idea right now, could you file an issue, or even debug it and tell us what’s wrong?
    c

    cedric

    5 years ago
    I think it’s happening in
    copyTo
    , which
    copyRecursively
    calls. Haven’t dug further