Did you try to read the documentation or to search ?
FileDelete("MyFolder\\"+MYfileNameWithExtensionIncluded,FILE_COMMON);
- www.mql5.com
Yes I did, as mentioned.
I just tried that code, but it's still not working. This is what I've tried:
FileDelete("test\\USDCAD.dica",FILE_COMMON);
See the location on the image attached.
This can't be that difficult..something is missing me..
Yes I did, as mentioned.
I just tried that code, but it's still not working. This is what I've tried:
See the location on the image attached.
This can't be that difficult..something is missing me..
FileDelete
Deletes the specified file in a local folder of the client terminal.
bool FileDelete( |
Parameters
file_name
[in] File name.
common_flag=0
[in] Flag determining the file location. If common_flag = FILE_COMMON, then the file is located in a shared folder for all client terminals \Terminal\Common\Files. Otherwise, the file is located in a local folder.
Return Value
In case of failure the function returns false.
Note
For security reasons, work with files is strictly controlled in the MQL5 language. Files with which file operations are conducted using MQL5 means, cannot be outside the file sandbox.
Deletes the specified file from a local folder of the client terminal (MQL5\Files or MQL5\Tester\Files in case of testing). If common_flag = FILE_COMMON, then the function removes the file from the shared folder for all client terminals \Terminal\Common\Files.
- www.mql5.com
I don't know how you are reading the documentation which is very clear. You need to place your files in Common\Files\ not directly in Common.
I am back (I am using a timer and the market was closed so I could not test it during the weekend).
Finally.... I guess I got confused when I read the "Common" bit... I assumed it was the "Common" folder and not "Common\Files".
Thank you for pointing this out. I knew this could not be that difficult!
It's now fixed and working.
Thank you very much to all.
- 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 have been trying to do a very simple operation for 2 days without success...delete a simple file.
This is an EA and this is what I have at the moment:
So, I want to delete "MYfileName" from the folder "MyFolder", inside the "Files" folder in MetaTrader common folder. Simple hein? Not to me...
I have tried to use this example from documentation:
So, I tried this:
I simply can't delete this file... And to get worse, there are no errors on the log file (experts tab).
Can anyone please tell me what am I doing wrong?
Thank you in advanced.