Download MetaTrader 5

FileOpen location

To add comments, please log in or register
jshumaker
507
jshumaker  

According to this link, https://www.mql5.com/en/docs/files/fileopen, if I use FileOpen my file should be created under my MQL5\files\ directory, but I do not have a files directory.  Under \MQL5 I have \experts, \images, \include, \indicators, \scripts.  I am not getting an error from an invalid handle and yet I cannot find the file. 

MQL5 directory = C:\Program Files\MetaTrader 5\MQL5

Documentation on MQL5: File Functions / FileOpen
Documentation on MQL5: File Functions / FileOpen
  • www.mql5.com
File Functions / FileOpen - Documentation on MQL5
jshumaker
507
jshumaker  

here is the code

int hfile;

   hfile=FileOpen("h1.csv",FILE_WRITE|FILE_CSV|FILE_COMMON,'|');

   if (hfile==INVALID_HANDLE)

      {printf("invalid file");}

   FileWrite(hfile,"test");

   FileClose(hfile);

Documentation on MQL5: Standard Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags
Documentation on MQL5: Standard Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags
  • www.mql5.com
Standard Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags - Documentation on MQL5
Alain Verleyen
Moderator
33629
Alain Verleyen  
jshumaker:

According to this link, https://www.mql5.com/en/docs/files/fileopen, if I use FileOpen my file should be created under my MQL5\files\ directory, but I do not have a files directory.  Under \MQL5 I have \experts, \images, \include, \indicators, \scripts.  I am not getting an error from an invalid handle and yet I cannot find the file. 

MQL5 directory = C:\Program Files\MetaTrader 5\MQL5

See here if it can help you.
khai hoan nguyen
242
khai hoan nguyen  

this is a useful code but i do not know how to use it.thanks share
jshumaker
507
jshumaker  

C:\Users\jeff\AppData\Roaming\MetaQuotes\Terminal\D0E8209F77C8CF37AD8BF550E51FF075\MQL5\Files

 I checked that directory and I still do not see any files.   

jshumaker
507
jshumaker  
never mind i finally found the stupid file in c:\programdata
To add comments, please log in or register