this article is great, thank you very much for the information.
А как можно уменшить размер файла? Примерно имею какой то BIN файл в которой поддерживаю какие то данни, потом делаю дефрагмент файла и наконец хочу умешнит его длина, потому что сзади уже есть лишное пространство. Как етого сделать? Нужна какая та функция типа FileResize(int newSize).
Thanks a lot, exactly what I was looking for.
There is just a little detail in some of the code examples.
On my computer / my version of mql5, the example for "file open" does not work.
I have changed it slightly, so that it works in my case.
See here below.
However, many thanks again, this is absolutely appreciated!!!
int h = FileOpen("test1.txt", FILE_WRITE|FILE_ANSI|FILE_COMMON,"|",CP_ACP);

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article MQL5 Programming Basics: Files has been published:
This practice-oriented article focuses on working with files in MQL5. It offers a number of simple tasks allowing you to grasp the basics and hone your skills.
After re-naming the file, open it. It opens in Notepad editor. Write 2-3 text lines to the file and save it. Make sure that ANSI encoding is selected in the drop-down list at the bottom of the Save As window (Fig. 1).
Fig. 1. Saving a text file in Windows Notepad. The red arrow shows the selected file encoding
Author: Dmitry Fedoseev