Copy File with MLQ4

 

 How can I copy a file?  This does not work:

#import "Kernel32.dll"

int start() {
  string Path = TerminalPath() +"\\experts\\";
  CopyFileA (Path + "\\files\\xyz.txt", Path + "\\files\\xyz2.txt", true  );
}

 ERROR: 'CopyFileA' - function is not defined


 
correct your declaration
#import "kernel32.dll"
   bool CopyFileA(string lpExistingFileName, string lpNewFileName, bool failIfExists); 
#import

int start() {
   ...
}
btw: as long as you operate in or under the "experts\file" directory you might use the builtin MQL file functions (if they fit your use case).
 
Is there a built-in MQL function for MT4 that will copy a file?  I see a function for MLQ5 but not MLQ4.
 
hknight:
Is there a built-in MQL function for MT4 that will copy a file?  I see a function for MLQ5 but not MLQ4.
Here are the file functions