Error open file: 5002

 

Hello everyone,

Unable to open file:


// Specify absolute path to file

string filePath = "F:\\F2\\1.txt"; // Path to file

int fileHandle;

fileHandle = FileOpen(filePath,FILE_SHARE_READ| FILE_READ);

Error opening file: 5002


What could be the reason?

Thank you!

Documentation on MQL5: Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags
Documentation on MQL5: Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags
  • www.mql5.com
File opening flag values specify the file access mode. Flags are defined as follows: One or several flags can be specified when opening a file...
 
User Name: string filePath = "F:\\F2\\1.txt"; // Path to file

File Write Problem (Error: 5002) - Expert Advisors and Automated Trading - MQL5 programming forum #1-2 (2020)
and FolderDelete using TERMINAL_DATA_PATH - General - MQL5 programming forum (2017)

Make a hard link for a file, or create a junction (mklink /J) at «DataFolder»\MQL4\Files\«other place» and use the regular file calls. (2022)