what about
bool moved=FileMove(m_filename,0,"OLD/"+m_filename.....);
Hi,
I am using Metatrader 4 on Linux Wine. I have a file in the folder "/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/xxx.csv"
I want MQL to delete this file or move the file to "/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/OLD/xxx.csv" after reading. I have this code:
But this does not work.... How should I correct this code?
Thanks
1) For reference, you can not navigate to any location on the file system. MT4 has this security constrain, as stated in: https://docs.mql4.com/files/
2) You are using a windows program (mt4) within linux. Path names are different in linux than in windows.
Your default based directory for mt4 in linux is:
"/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files"
So, if you refer to a file xxx.csv with this path:
/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/xxx.csv
then you could use just:
string src_path = "xxx.csv"
Now, you want to refer to destination OLD/ with following path
/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/OLD/
Then use:
string dst_path = StringConcatenate("OLD\", "xxx.csv");
with backslash. That's it.
3) You could skip constrain 1) by creating links within the default directory to the desired files. (you probably can not create a single link to a whole directory in linux, as it is not longer allowed, even for superuser, so you would have to create a link for each individual file)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I am using Metatrader 4 on Linux Wine. I have a file in the folder "/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/xxx.csv"
I want MQL to delete this file or move the file to "/home/user/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/OLD/xxx.csv" after reading. I have this code:
But this does not work.... How should I correct this code?
Thanks