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.
The file is opened in the folder of the client terminal in the subfolder MQL5\files (or testing_agent_directory\MQL5\files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 5 client terminals.
"Named pipes" can be opened according to the following rules:
•Pipe name is a string, which should have the following look: "\\servername\pipe\pipename", where servername - server name in the network, while pipename is a pipe name. If the pipes are used on the same computer, the server name can be omitted but a point should be inserted instead of it: "\\.\pipe\pipename". A client trying to connect the pipe should know its name.
•FileFlush() and FileSeek() should be called to the beginning of a file between sequential operations of reading from the pipe and writing to it.
A special symbol '\' is used in shown strings. Therefore, '\' should be doubled when writing a name in MQL5 application. It means that the above example should have the following look in the code: "\\\\servername\\pipe\\pipename".
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.
The file is opened in the folder of the client terminal in the subfolder MQL5\files (or testing_agent_directory\MQL5\files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 5 client terminals.
"Named pipes" can be opened according to the following rules:
•Pipe name is a string, which should have the following look: "\\servername\pipe\pipename", where servername - server name in the network, while pipename is a pipe name. If the pipes are used on the same computer, the server name can be omitted but a point should be inserted instead of it: "\\.\pipe\pipename". A client trying to connect the pipe should know its name.
•FileFlush() and FileSeek() should be called to the beginning of a file between sequential operations of reading from the pipe and writing to it.
A special symbol '\' is used in shown strings. Therefore, '\' should be doubled when writing a name in MQL5 application. It means that the above example should have the following look in the code: "\\\\servername\\pipe\\pipename".
thnaks for replay
Can you please help me modify my code
;)
thnaks for replay
Can you please help me modify my code
;)
string filename="c:\\test.csv";
try
Did you read the reply of luenbo ? YOU CAN'T OPEN FILE outside "the subfolder MQL5\files (or testing_agent_directory\MQL5\files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 5 client terminals."

- www.mql5.com
Did you read the reply of luenbo ? YOU CAN'T OPEN FILE outside "the subfolder MQL5\files (or testing_agent_directory\MQL5\files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 5 client terminals."
I use this trick but I could not
#import "kernel32.dll" bool CopyFileA(string lpExistingFileName, string lpNewFileName, bool failIfExists); #import .... .. CopyFileA ("test.csv","c:\\"test.csv", true )
Yes I read it, but he said that I could not do method
I quoted your post ^ ^ ^ ^ ^ so you know I am replying to you, angevoyageur quoted the post from b3ck1 not from you so his reply is meant for b3ck1

I use this trick but I could not
Why do you need to do that ? It's a bad idea to bypass security when you do not even understand why it exists.
The best solution, if you really need to open file outside MQL5 folders, it to use named pipe : Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs
Why do you need to do that ? It's a bad idea to bypass security when you do not even understand why it exists.
The best solution, if you really need to open file outside MQL5 folders, it to use named pipe : Communicating With MetaTrader 5 Using Named Pipes Without Using DLLs

- 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 just want the folder to be opened c:\
Thank you ;)