API Reference › Fs › Fs.copy
method

Fs.copy

Fs.copy(src, dst) -> bool

Copies a file's bytes to a new path (atomically at the destination), returning true on success. Binary-safe, so it works for assets as well as text. Copying directories is a follow-up.

Parameters

srcthe source path
dstthe destination path

Example

program Copy {
  entry {
    if Fs.copy("saves/slot1.json", "saves/slot1.bak") { print(1) }
  }
}
← All symbols