copy_filecopy_fileCopyFileCopyFilecopy_file (Operator)

Name

copy_filecopy_fileCopyFileCopyFilecopy_file — Copy a file to a new location.

Signature

copy_file( : : SourceFile, DestinationFile : )

Herror copy_file(const char* SourceFile, const char* DestinationFile)

Herror T_copy_file(const Htuple SourceFile, const Htuple DestinationFile)

void CopyFile(const HTuple& SourceFile, const HTuple& DestinationFile)

static void HMisc::CopyFile(const HString& SourceFile, const HString& DestinationFile)

static void HMisc::CopyFile(const char* SourceFile, const char* DestinationFile)

static void HMisc::CopyFile(const wchar_t* SourceFile, const wchar_t* DestinationFile)   (Windows only)

static void HOperatorSet.CopyFile(HTuple sourceFile, HTuple destinationFile)

static void HMisc.CopyFile(string sourceFile, string destinationFile)

def copy_file(source_file: str, destination_file: str) -> None

Description

copy_filecopy_fileCopyFileCopyFileCopyFilecopy_file copies SourceFileSourceFileSourceFileSourceFilesourceFilesource_file to DestinationFileDestinationFileDestinationFileDestinationFiledestinationFiledestination_file. Existing files are silently overwritten. The file attributes of SourceFileSourceFileSourceFileSourceFilesourceFilesource_file are kept.

Execution Information

Parameters

SourceFileSourceFileSourceFileSourceFilesourceFilesource_file (input_control)  filename.read HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File to be copied.

DestinationFileDestinationFileDestinationFileDestinationFiledestinationFiledestination_file (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Target location.

Result

copy_filecopy_fileCopyFileCopyFileCopyFilecopy_file returns the value 2 (H_MSG_TRUE) if the file could be copied. Otherwise, an exception is raised.

Module

Foundation