because you are using the non-working example as reference. You deal with absolute paths, that does not work.
SteelAce:
Problem is that files are (as if) possible to read-write only in directory ...\Files (and without giving full path of filename) but I need to Read-Write file on another drive, for exampe on drive D:\
In MQL5 Reference -> File Functions -> FileOpen is sample what is in this letter attachment as Sample.mq5. When you run that sample you can see that file can be written only when you give part of file path (last part of that Sample.mq5). When you give full path then file writing is unsuccessful even in that Sample.mq5 [Error code 5002 (: Invalid file name)]. In that case filename is "C:\Program Files\MetaTrader 5 Admiral Markets UK Ltd\MQL5\Files\fractals.csv" found by TerminalInfoString(TERMINAL_DATA_PATH) (Sample.mq5) . I don't understand how it can be wrong?
SteelAce:
Problem is that files are (as if) possible to read-write only in directory ...\Files (and without giving full path of filename) but I need to Read-Write file on another drive, for exampe on drive D:\
You can not go outside of the terminal directory.
Problem is that files are (as if) possible to read-write only in directory ...\Files (and without giving full path of filename) but I need to Read-Write file on another drive, for exampe on drive D:\

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
In MQL5 Reference -> File Functions -> FileOpen is sample what is in this letter attachment as Sample.mq5. When you run that sample you can see that file can be written only when you give part of file path (last part of that Sample.mq5). When you give full path then file writing is unsuccessful even in that Sample.mq5 [Error code 5002 (: Invalid file name)]. In that case filename is "C:\Program Files\MetaTrader 5 Admiral Markets UK Ltd\MQL5\Files\fractals.csv" found by TerminalInfoString(TERMINAL_DATA_PATH) (Sample.mq5) . I don't understand how it can be wrong?