我正在使用 Ubuntu 14 并尝试创建一个脚本来写入文件,但5004
每次尝试打开文件时都会出现错误。
datetime currtime;
bool newcandle;
string terminal_data_path = TerminalInfoString( TERMINAL_DATA_PATH );
string filename = terminal_data_path + "\\MQL4\\Files\\" + "data.csv";
int filehandle;
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" );
}
如何在 Ubuntu 上解决这个问题?
更新
我试图将我的文件更改为以下内容:
string terminal_data_path = TerminalInfoString( TERMINAL_DATA_PATH );
string filename = terminal_data_path + "\\tester\\files\\data.csv";
就为了这个
string filename = "\\tester\\files\\data.csv";
为此
string filename = "\\files\\data.csv";
但我仍然收到错误,但这次5002
不是5004
。