SOLVED. Please apologize this post. Within the sandbox, no absolute path accepted. Do it this way:
string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH); string filename="mytest.csv"; int filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV); if(filehandle<0) { Print("Failed to open the file by the absolute path "+filename); Print("Error code ",GetLastError()); }
In my case file is written to:
C:\Users\general\AppData\Roaming\MetaQuotes\Tester\B2816E90C35C2BD793EFA45DDB08414F\Agent-127.0.0.1-3000

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
have problem with writing file from within OnTest
filehandle=5002
From journal
2012.07.25 23:16:00 Core 1 2012.07.23 23:59:59 Failed to open the file by the absolute path C:\Users\general\AppData\Roaming\MetaQuotes\Tester\B2816E90C35C2BD793EFA45DDB08414F\Agent-127.0.0.1-3000\mytest.csv
The path
C:\Users\general\AppData\Roaming\MetaQuotes\Tester\B2816E90C35C2BD793EFA45DDB08414F\Agent-127.0.0.1-3000
exists but no file in it.
Anyone knows what's going on ?
Thank you