Need Help with the FileMove from Common Folder to Common Foler

 

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_name,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.

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=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);

}

 

solved!

just changed the 0 to FILE_COMMON and it works.

how can i close this post or delete post?