Scoop API

scoop:scoop.platform:0.1.0

src/fs/files.scoop

Selected production source · src/fs/files.scoop

1package scoop.platform.fs
3import scoop.platform.env.temporaryDirectory
5/**
6 * Creates a unique temporary file in the chosen parent and returns its path. The caller owns
7 * deletion responsibility.
8 */
9public fun createTempFile(parent: Path? = None, prefix: String = "scoop-"): Path =
10 createPlatformTemporaryPath(parent ?: temporaryDirectory(), prefix, false)
12/**
13 * Creates a unique temporary directory in the chosen parent. The caller owns deletion
14 * responsibility.
15 */
16public fun createTempDirectory(parent: Path? = None, prefix: String = "scoop-"): Path =
17 createPlatformTemporaryPath(parent ?: temporaryDirectory(), prefix, true)