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:
string src_path=StringConcatenate("/home/morry/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/"+m_filename);
string dst_path=StringConcatenate("/home/morry/.wine/drive_c/Program Files (x86)/MetaTrader 4/MQL4/Files/OLD/"+m_filename);
But this does not work.... How should I correct this code?
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/
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)
To add comments, please log in or register