Logo

Programming-Idioms

  • Pascal
  • Dart
  • C#

Idiom #228 Copy a file

Copy the file at path src to dst.

System.IO
File.Copy(src, dst, true); 

The 3rd argument true means "may overwrite".
uses FileUtil;
Success := CopyFile(src, dst);

CopyFile returns True upon success, False upon failure
import 'dart:io';
File(src).copySync(dst);
with Ada.Directories;
Ada.Directories.Copy_File (Source_Name => Src,
                           Target_Name => Dst);

New implementation...