Operator Reference

copy_filecopy_fileCopyFileCopyFilecopy_file (Operator)

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_fileCopyFileCopyFilecopy_file copies SourceFileSourceFileSourceFilesourceFilesource_file to DestinationFileDestinationFileDestinationFiledestinationFiledestination_file. Existing files are silently overwritten. The file attributes of SourceFileSourceFileSourceFilesourceFilesource_file are kept.

Execution Information

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).
  • Multithreading scope: global (may be called from any thread).
  • Processed without parallelization.

Parameters

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

File to be copied.

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

Target location.

Result

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

Module

Foundation