Download MetaTrader 5
To add comments, please log in or register
Your conversation partner speaks foreign language? Automatic translation will help you!
daytradingzoo
44
daytradingzoo 2015.06.11 13:59 

Hi,

 I'm trying to run through a number of files that are located in my FILE_COMMON directory. In this directory I have the following structure

NTOutput\Handled\
NTOutput\OrderTickets\
NTOutput\Pending\

I would like to look in the OrderTickets\ folder and show all files that are located in this folder. So I tried the following code:

      string file_name;
      long search_handle=FileFindFirst("NTOutput\\OrderTickets\\*",file_name);
      if(search_handle!=INVALID_HANDLE)
      {
         do
         {
            Print("file_name = ", file_name);
         }
         while( FileFindNext(search_handle,file_name) );
         FileFindClose(search_handle);
      }
      else
         Print("Files not found!");

Unfortunately this gives me a File Not Found message. Apparently it cannot find the OrderTickets directory because it's not the first directory of the NTOutput folder.

When I remove the OrderTickets fromthe FileFindFirst method I get the Handled\ folder returned. I guess it can only find the first folder.

Anyone got any suggestions how I can solve this?

Much appreciated. 

Alain Verleyen
Moderator
28535
Alain Verleyen 2015.06.12 14:46  

If you want to work with COMMON directory you have to specify the flag :

      long search_handle=FileFindFirst("NTOutput\\OrderTickets\\*",file_name,FILE_COMMON);
/
To add comments, please log in or register