-
Play videoPlease edit your post.
For large amounts of code, attach it.
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?
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
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?