Scoop API

scoop:scoop.platform:0.1.0

File

class File

source · line 27
public
public class File private constructor(
    private val context: OsString?
) : ByteSource, ByteSink, Closeable

An owned native file handle with byte I/O, positioning, metadata, and explicit durability operations. Close it after use.

Extensions

function position

source · line 39
public
public fun position(): Long

Queries the current file offset in bytes.

function duplicate

source · line 140
public
public fun duplicate(): File

Duplicates the native descriptor into a separately owned File. Descriptor duplication shares the underlying open-file offset.

function close

source · line 299
public
public override fun close(): Unit

Closes the owned native handle; subsequent I/O through this owner is invalid.

function syncData

source · line 258
public
public fun syncData(): Unit

Requests persistence of data and metadata required to retrieve the data.

function flush

source · line 292
public
public override fun flush(): Unit
  • Overrides flush · ByteSink

Checks that the descriptor is open. File writes are unbuffered here; use syncData or syncAll for durability.

function syncAll

source · line 264
public
public fun syncAll(): Unit

Requests persistence of data and full file metadata.

function size

source · line 43
public
public fun size(): Long

Queries the current file length in bytes.