System

sealed external interface System(source)

Properties

Link copied to clipboard
abstract var args: ReadonlyArray<String>
Link copied to clipboard
abstract val base64decode: (input: String) -> String?
Link copied to clipboard
abstract val base64encode: (input: String) -> String?
Link copied to clipboard
abstract val clearScreen: () -> Unit?
Link copied to clipboard
abstract val clearTimeout: (timeoutId: Any?) -> Unit?
Link copied to clipboard
abstract val createHash: (data: String) -> String?

A good implementation is node.js' crypto.createHash. (https://nodejs.org/api/crypto.html#crypto_crypto_createhash_algorithm)

Link copied to clipboard
abstract val createSHA256Hash: (data: String) -> String?

This must be cryptographically secure. Only implement this method using crypto.createHash("sha256").

Link copied to clipboard
abstract val deleteFile: (path: String) -> Unit?
Link copied to clipboard
abstract val getFileSize: (path: String) -> Double?
Link copied to clipboard
abstract val getMemoryUsage: () -> Double?
Link copied to clipboard
abstract val getModifiedTime: (path: String) -> Date??
Link copied to clipboard
abstract val getWidthOfTerminal: () -> Double?
Link copied to clipboard
abstract var newLine: String
Link copied to clipboard
abstract val realpath: (path: String) -> String?
Link copied to clipboard
abstract val setModifiedTime: (path: String, time: Date) -> Unit?
Link copied to clipboard
abstract val setTimeout: Function<Any?>?
Link copied to clipboard
Link copied to clipboard
abstract val watchDirectory: (path: String, DirectoryWatcherCallback, recursive: Boolean?, options: WatchOptions?) -> FileWatcher?
Link copied to clipboard
abstract val watchFile: (path: String, FileWatcherCallback, pollingInterval: Double?, options: WatchOptions?) -> FileWatcher?
Link copied to clipboard
abstract val writeOutputIsTTY: () -> Boolean?

Functions

Link copied to clipboard
abstract fun createDirectory(path: String)
Link copied to clipboard
abstract fun directoryExists(path: String): Boolean
Link copied to clipboard
abstract fun exit(exitCode: Double = definedExternally)
Link copied to clipboard
abstract fun fileExists(path: String): Boolean
Link copied to clipboard
abstract fun getCurrentDirectory(): String
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun readDirectory(path: String, extensions: ReadonlyArray<String> = definedExternally, exclude: ReadonlyArray<String> = definedExternally, include: ReadonlyArray<String> = definedExternally, depth: Double = definedExternally): ReadonlyArray<String>
Link copied to clipboard
abstract fun readFile(path: String, encoding: String = definedExternally): String?
Link copied to clipboard
abstract fun resolvePath(path: String): String
Link copied to clipboard
abstract fun write(s: String)
Link copied to clipboard
abstract fun writeFile(path: String, data: String, writeByteOrderMark: Boolean = definedExternally)