under Terminal\Common\Files\ folder
i have 2 sub-directories called 1todo and 2done
under 1todo folder i have 1.txt, 2.txt,3.txt,4.txt,5.txt
i am trying to move all the files in 1todo to 2done.
it works between local folder, and it works move from local folder to common folder
but did not work, move from common folder to common folder.
need some help, thanks.
my guess would be
FileMove(from_folder+file_name,0,to_folder+file_na me,FILE_COMMON);
the FILE_COMMON flag only subjected to the destination folder, but not the source folder, so it still check the files in local path.
I download the MQL4 File Functions (MQL4 File Functions Replacement) from Coders' Guru
MQL4 File Functions Replacement - MT4 - Metatrader 4 File Functions DLL
but the dll file doesnt include the gFileMove function.
i have 2 sub-directories called 1todo and 2done
under 1todo folder i have 1.txt, 2.txt,3.txt,4.txt,5.txt
i am trying to move all the files in 1todo to 2done.
it works between local folder, and it works move from local folder to common folder
but did not work, move from common folder to common folder.
need some help, thanks.
my guess would be
FileMove(from_folder+file_name,0,to_folder+file_na me,FILE_COMMON);
the FILE_COMMON flag only subjected to the destination folder, but not the source folder, so it still check the files in local path.
I download the MQL4 File Functions (MQL4 File Functions Replacement) from Coders' Guru
MQL4 File Functions Replacement - MT4 - Metatrader 4 File Functions DLL
but the dll file doesnt include the gFileMove function.
Inserted Code
void OnTick() { // string filter="*"; string from_folder = "1todo/"; string file_name; long search_handle=FileFindFirst(from_folder+filter,file_name,FILE_COMMON); if(search_handle!=INVALID_HANDLE) { FileIsExist(file_name); Print("File name is = "+file_name); FileFindClose(search_handle); } else Print("Files not found!"); //Put the data into the records array string records[15]; int handle=FileOpen(from_folder+file_name,FILE_CSV|FILE_WRITE|FILE_READ|FILE_COMMON,','); if(handle>0) { for(int i = 0; i<ArraySize(records);i++) { records[i]=FileReadString(handle); if(FileIsLineEnding(handle) == true ) break; } } Print("5th record is = "+records[5]); FileClose(handle); string to_folder = "2done/"; FileMove(from_folder+file_name,0,to_folder+file_name,FILE_COMMON); }