relativeToOrNull

JVM
1.0
fun File.relativeToOrNull(base: File): File?

Calculates the relative path for this file from base file. Note that the base file is treated as a directory. If this file matches the base file, then a File with empty path will be returned.

Return File with relative path from base to this, or null if this and base paths have different roots.