Copy File

From SwiftAPI

Jump to: navigation, search

Contents

C#

msdn

System.IO.File : public static void Copy(
    string sourceFileName,
    string destFileName
)
System.IO.File : public static void Copy(
    string sourceFileName,
    string destFileName,
    bool overwrite
)
using System.IO;
 
string source = "file.txt";
string dest = "file2.txt";
File.Copy(source, dest);

Perl

use File::Copy;
$source = 'file.txt';
$dest = 'file2.txt';
copy($source, $dest);

PHP

php.net

bool copy ( string $source , string $dest [, resource $context ] )
$source = 'file.txt';
$dest = 'file2.txt';
copy($source, $dest);

Python

docs.python.org

import shutil
source = 'file.txt'
dest = 'file2.txt'
shutil.copy(source, dest)

Ruby

require 'ftools'
source = 'file.txt'
dest = 'file2.txt'
File.copy(source, dest)
Personal tools