Scoop API

scoop:scoop.platform:0.1.0

platform/posix/files.scoop

Selected production source · platform/posix/files.scoop

1package scoop.platform.fs
3import scoop.platform.system.OsString
5@Unsafe
6internal fun <R> Path.withPlatformPath(block: (Ptr<Byte>) -> R): R = withNativePath(block)
8@Unsafe
9internal fun <R> OsString.withPlatformString(block: (Ptr<Byte>) -> R): R = withNativeString(block)
11@Unsafe
12internal fun copyPlatformString(pointer: Ptr<Byte>, length: Long): OsString =
13 OsString.fromByteArray(
14 Array<Byte>(length) {
15 index -> @Unsafe
16 {
17 return@Array pointer.load(index)
18 }
19 }
20 )