Cannot open file on Ubuntu

 

I'm using Ubuntu 14 and trying to create a script to write files, but I'm getting the 5004 error, every time I try to open a file.

datetime currtime;

bool newcandle;

string terminal_data_path=TerminalInfoString(TERMINAL_DATA_PATH);

string filename=terminal_data_path+"\\MQL4\\Files\\"+"data.csv"; 

 

filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV);

             if(filehandle<0)

               {

                Print("Failed to open the file by the absolute path ");

                Print("Error code ",GetLastError());

               } else 

               {

                    Print("file opened with sucess");

               } 

 How can I solve this problem on Ubuntu? 

 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. string filename=terminal_data_path+"\\MQL4\\Files\\"+"data.csv"; 
    Use this. Been ask and answered many times.
 

Thanks. I had search for the problem, but didn't a similar problem (specifically open file in a linux env).

 I tried your approach, but I'm still getting the 5004 error. Take a look at my code: 

 

 

string filename= "data.csv";

int filehande 

     filehandle=FileOpen(filename,FILE_WRITE|FILE_CSV,";");

             if(filehandle==INVALID_HANDLE)

               {

                   

                Print("Failed to open the file by the absolute path ");

                Print("Error code ",GetLastError());

               } else 

               {

                    Print("file opened with sucess");

               }

     

     

     } 
 
Have you checked for the Error codes?
Reason: