with FileWrite, it only writes into application storage direcory (in C:\Users\username\AppData\Roaming\MetaQuotes\Terminal\50CA3DFB510CC5A8F28B48D1BF2A5702\tester\files\ )
However, when doing
it doesnt create a file there. why ? (maybe windows restriction?)
"For security reasons, work with files is strictly controlled in the MQL4 language. Files with which file operations are conducted using MQL4 means, cannot be outside the file sandbox.
The file is opened in the folder of the client terminal in the subfolder MQL4\files (or Tester\Files in case of testing). If FILE_COMMON is specified among flags, the file is opened in a shared folder for all MetaTrader 4 client terminals."
"C:/file.txt" is clearly at the root of the C: file system and not under your "Terminal\50CA3DFB510CC5A8F28B48D1BF2A5702\tester\files" directory