Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Demo_FileFind - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources

author EAcpu | 5 reads | 0 comments |

This script is a simple example of using functions to search and manipulate files and directories.

The script searches and displays the names of all files and directories located in the "Experts" folder in the terminal's local folder. The following command can be called to obtain the terminal local folder location terminal information string () function.

 Printing format ( "Path of terminal local folder: %s\\Files\\" , terminal information string ( terminal data path ));

The script uses the useful propertiesFileExists () function to find directories. If the name of the current directory is specified in the function argument, the function will return "false" and the _last error variable will log error 5018 - "This is not a file, this is a directory".

You can find more information describing the FileFindFirst (), FileFindNext () and FileFindOff () functions in the Help.


Attachment download

📎 demo_filefindfirst.mq5 (1.76 KB)

Source: MQL5 #1609

Verification code Refresh