File

class File(path: String)

Represents a file in raylib.

Constructors

Link copied to clipboard
constructor(path: String)
constructor(parent: File, subpath: String)

Creates a new file with a parent.

Properties

Link copied to clipboard

The absolute path of the file.

Link copied to clipboard

Checks if the current path points to a directory.

Link copied to clipboard

Checks if the current path points to a file.

Link copied to clipboard
val length: Int

Gets the length of the file in bytes.

Link copied to clipboard

The path of the parent directory.

Functions

Link copied to clipboard

Deletes this file or directory.

Link copied to clipboard

Deletes this folder and all of its contents. If it is not a folder, this will call false.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Checks if the path exists, either as a file or directory.

Link copied to clipboard
fun files(deep: Boolean = false, filter: String? = null): List<File>

Loads all files inside parentDir.

Link copied to clipboard

Gets the file extension of the current path, if it exists.

Link copied to clipboard

Gets the name of the file of the current path, if it exists.

Link copied to clipboard

Gets the name of the file of the current path, excluding the extension.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun mkdir(): Boolean

Creates a directory at the path, with any parent directories created if not exist.

Link copied to clipboard

Reads a byte array from the specified file.

Link copied to clipboard

Reads the text from the specified file.

Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
fun writeBytes(bytes: ERROR CLASS: Symbol not found for UByteArray): Boolean

Writes an unsigned byte array to the specified file.

Writes a byte array to the specified file.

Link copied to clipboard
fun writeCode(output: File): Boolean

Writes this file's data to another file as a code source (*.h) file.

Link copied to clipboard

Writes the text from the specified file.