Package-level declarations

Types

Link copied to clipboard
object ANDROID
Link copied to clipboard
value class Buffer

If printing to console, use unwrap beforehand, otherwise will not print the contents of buffer_Buffer.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPEALIAS])
annotation class DelicateFileApi

Denotes an api as being delicate. Probably shouldn't use it.

Link copied to clipboard
expect open class EOFException : IOException
actual open class EOFException : IOException
Link copied to clipboard
expect class File(pathname: String) : Comparable<File>

A File

actual typealias File = java.io.File
actual class File(pathname: String) : Comparable<File>
Link copied to clipboard
Link copied to clipboard
expect open class InterruptedException : Exception
actual open class InterruptedException : Exception
Link copied to clipboard
expect open class IOException : Exception
actual typealias IOException = java.io.IOException
actual open class IOException : Exception
Link copied to clipboard
value class Stats

Properties

Link copied to clipboard
@get:JvmName(name = "absoluteFileOf")
val File.absoluteFile: File

absolutePath but returns a file

Link copied to clipboard
@get:JvmName(name = "absolutePathOf")
val File.absolutePath: String

Returns the absolute pathname string of this abstract pathname.

Link copied to clipboard
val Throwable.errorCodeOrNull: String?
Link copied to clipboard
@get:JvmName(name = "nameOf")
val File.name: String

The name of the file or directory. The last segment of the path.

Link copied to clipboard
@get:JvmName(name = "parentFileOf")
val File.parentFile: File?

The path parent. If no parent is available, null is returned.

Link copied to clipboard
@get:JvmName(name = "parentPathOf")
val File.parentPath: String?

The path parent. If no parent is available, null is returned.

Link copied to clipboard
@get:JvmName(name = "pathOf")
val File.path: String

The abstract path to a directory or file

Link copied to clipboard
@JvmField
val SysDirSep: Char

The operating system's directory separator character.

Link copied to clipboard
@JvmField
val SysTempDir: File

The system's temporary directory

Functions

Link copied to clipboard
@JvmName(name = "canonicalFileOf")
fun File.canonicalFile(): File

canonicalPath but returns a file

Link copied to clipboard
@JvmName(name = "canonicalPathOf")
fun File.canonicalPath(): String

Returns the canonical pathname string of this abstract pathname.

Link copied to clipboard
Link copied to clipboard
inline fun <T> File.fOpen(flags: String, block: (file: CPointer<FILE>) -> T): T

Opens the File, closing it automatically once block completes.

Link copied to clipboard
fun CPointer<FILE>.fRead(buf: ByteArray): Int

Reads the contents of FILE into provided ByteArray.

Link copied to clipboard
fun CPointer<FILE>.fWrite(buf: ByteArray, offset: Int = 0, len: Int = buf.size): Int

Writes buf to FILE

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "normalizedFileOf")
fun File.normalize(): File

Removes all . and resolves all possible .. for the provided path.

Link copied to clipboard
Link copied to clipboard
@JvmName(name = "readBytesFrom")
fun File.readBytes(): ByteArray

Read the full contents of the file (as bytes).

Link copied to clipboard
@JvmName(name = "readUtf8From")
fun File.readUtf8(): String

Read the full contents of the file (as UTF-8 text).

Link copied to clipboard
fun File.resolve(relative: File): File

Resolves the File for provided relative. If relative is absolute, returns relative, otherwise will concatenate the File.paths.

fun File.resolve(relative: String): File
Link copied to clipboard
fun File.stat(): Stats
Link copied to clipboard
@JvmName(name = "get")
fun String.toFile(): File
Link copied to clipboard
fun Throwable.toIOException(): IOException
Link copied to clipboard
@JvmName(name = "wrapIO")
fun Throwable.wrapIOException(): IOException

Ensures that the throwable is an instance of IOException. If it is not, it will encase it in one.

@JvmName(name = "wrapIO")
fun Throwable.wrapIOException(lazyMessage: () -> String): IOException

Ensures that the throwable is an instance of IOException. If it is not, it will encase it in one with the provided lazyMessage.

Link copied to clipboard
fun File.write(data: Buffer)
Link copied to clipboard
@JvmName(name = "writeBytesTo")
fun File.writeBytes(array: ByteArray)

Writes the full contents of array to the file

Link copied to clipboard
@JvmName(name = "writeUtf8To")
fun File.writeUtf8(text: String)

Writes the full contents of text to the file (as UTF-8)