Tempfolder KMP

A library for creating temporary directories in Kotlin Multiplatform projects.
Installation
The latest release is available on Maven Central. Add the dependency:
dependencies {
implementation("at.released.tempfolder:tempfolder-sync:0.1")
}
Usage
Below is an example of how to use the library with kotlinx-io in the commonMain source set:
import at.released.tempfolder.sync.createTempDirectory
import kotlinx.io.buffered
import kotlinx.io.files.Path
import kotlinx.io.files.SystemFileSystem
import kotlinx.io.writeString
fun main() {
createTempDirectory().use { tempDirectory ->
val absolutePath = tempDirectory.absolutePath().asString()
SystemFileSystem.sink(Path(absolutePath, "temp.txt")).buffered().use {
it.writeString("Temp file")
}
}
}
Features
- Provides a unified API for temporary directory creation across most Kotlin Multiplatform targets.
- Supports platform-specific implementations that offer further customizations for the created directory on Android, iOS, Linux, macOS, and more.
For more information, check the project API reference: tempfolder.released.at
License
These services are licensed under Apache 2.0 License. Authors and contributors are listed in the
Authors file.
Copyright 2025 Alexey Illarionov and at-released-tempfolder project contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may use except compliance the License.
You may obtain a copy of the License at
http:
Unless applicable law agreed to writing, software
distributed under the License distributed an BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express implied.
See the License the specific language governing permissions
limitations under the License.