Issue with file save from tester to /MQL5/Files/

Enrique Dangeroux
815
Enrique Dangeroux  
//+------------------------------------------------------------------+
//|                                                    file_test.mq5 |
//|                        Copyright 2019, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2019, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
  
   ResetLastError(); 
   int filehandle=FileOpen("fractals.csv",FILE_WRITE|FILE_CSV|FILE_COMMON); 
   if(filehandle!=INVALID_HANDLE) 
     { 
      FileWrite(filehandle,TimeCurrent(),Symbol(), EnumToString(_Period)); 
      FileClose(filehandle); 
      Print("FileOpen OK"); 
     } 
   else Print("Operation FileOpen failed, error ",GetLastError()); 
   
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   
  }
//+------------------------------------------------------------------+

The above code prints "FileOpen OK" however, there is no file to be seen in the common folder /MQL5/Files, nor in the tester sandbox /Files/ location.

Usually the human is in error so, am i missing something here?

Anthony Garot
5265
Anthony Garot  
Enrique Dangeroux:

The above code prints "FileOpen OK" however, there is no file to be seen in the common folder /MQL5/Files, nor in the tester sandbox /Files/ location.

Usually the human is in error so, am i missing something here?

Works for me from just running the EA and from the Tester.

works for me

Enrique Dangeroux
815
Enrique Dangeroux  
Anthony Garot:

Works for me from just running the EA and from the Tester.


Thanks for investigating. 

Strange, i run MT5 build 2085. Running the EA also gives me zero file.

Anthony Garot
5265
Anthony Garot  
Enrique Dangeroux:

Thanks for investigating. 

Strange, i run MT5 build 2085. Running the EA also gives me zero file.

I am running same build. Windows 7.
Enrique Dangeroux
815
Enrique Dangeroux  

When i remove the FILE_COMMON flag, i do get the file in /MQL5/Files when i run the EA and when i run EA in Tester the file is also created in the agents folder. Just as you would expect.

But with FILE_COMMON, it creates no files, not in either of the two locations.

William Roeder
24704
William Roeder  
Enrique Dangeroux: But with FILE_COMMON, it creates no files, not in either of the two locations.

Because it should not. Not in /files. Not in /tester/files. Only in the common/files folder.

Enrique Dangeroux
815
Enrique Dangeroux  

For some reason i had /MQL5/Files in mind as common files folder. Corrected now.

Thanks you both!