MQL5 - FileOpen returning invalid handle on Mac OS running Parallels Desktop.

 

I'm working on an EA that needs to read files that other python scripts are creating on my machine. I've changed from Windows to Mac and been running MetaTrader5 on Parallels Desktop with no problem until now.. 

I was running the same script in my windows machine and everything was ok..

Here's the code that I was using for reading a file to an array:

bool ReadFileToArray(string FileName,string & Lines[])
  {
   ResetLastError();
   int h=FileOpen(FileName,FILE_READ|FILE_ANSI|FILE_TXT);
   if(h==INVALID_HANDLE)
     {
      int ErrNum=GetLastError();
      printf("Error opening file %s # %i",FileName,ErrNum);
      return(false);
     }
   int cnt=0; 
   while(!FileIsEnding(h))
     {
      string str=FileReadString(h); 
      StringTrimLeft(str);
      StringTrimRight(str);
      if(str!="")
        {
         if(cnt>=ArraySize(Lines)) 
           {
            ArrayResize(Lines,ArraySize(Lines)+1024); 
           }
         Lines[cnt]=str; 
         cnt++; 
        }
     }
   ArrayResize(Lines,cnt);
   FileClose(h);
   return(true);
  }

And then

string ativos[];

int OnInit()
  {

   ReadFileToArray("ativos.txt", ativos); // file located in the same folder as the .mq5 file
   return(INIT_SUCCEEDED);

  }

I also tried opening the same file but at /Users/wilson/Documents and had the same error (#5004, I've already read the documentation but couldn't understand why the error was raised).

Any ideas in how to resolve this issue?

Cheers;

 
On mac os, FileOpen works if the FILE_COMMON flag is specified
Reason: