I am using Okio in Kotlin/Native. How do I check if a path (for example /path/to/directory
) denotes a directory?
The scope of the check has to involve using the file system to check if the path denotes a file or a directory.
Example:
"/path/to/directory".toPath().isDirectory // should be true if it exists as a directory
"/path/to/file.txt".toPath().isDirectory // should be false if it does not exist or exists but is a file