KoryFile
A platform-agnostic file wrapper backed by Kotlinx IO.
Provides a unified API for reading, writing, and inspecting files across all Kotlin Multiplatform targets.
Samples
// Getting files from path.
val file = KoryFile.fromPath(filePath) // This function can be thrown a FileNotFoundException!
println(file.mimeTypeStr())Content copied to clipboard
Functions
Link copied to clipboard
Returns the underlying Kotlinx IO Path.
Link copied to clipboard
Link copied to clipboard
Detects the MIME type of the file as a string.
Link copied to clipboard
Opens a buffered source for reading the file.
Link copied to clipboard
Writes the given bytes to the file, creating parent directories if needed.