/* * Copyright 2026 Flix Authors * * Use of this source code is governed by the Apache 2.0 license * that can be found in the LICENSE.md file. */////// Effect for copying a file, and its functions.///pubmod Fs.CopyFile {use Fs.FileWriteuse Fs.CopyFileuse Fs.CopyOption////// Effect for copying a file.////// Use the `CopyFile.runWithFileWrite` handler.///pubeffCopyFile {////// Copies the file `src` to `dst` with the given `options`.///defcopyWith(src: {src = String}, dst: String, opts: Set[CopyOption]): Result[IoError, Unit] }////// Convenience function: copies `src` to `dst` with no options.///pubdefcopy(src: {src = String}, dst: String): Result[IoError, Unit] \ CopyFile =Fs.CopyFile.copyWith(src, dst, Set.empty())////// Handles the `CopyFile` effect of the given function `f` using the `FileWrite` effect.///pubdefrunWithFileWrite(f: Unit -> a \ ef): a \ (ef - CopyFile) + FileWrite =run { f() } withhandlerCopyFile {defcopyWith(src, dst, opts, k) = k(Fs.FileWrite.copyWith(src, dst, opts)) }}