If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
//+------------------------------------------------------------------+//| FLtest.mq4 |//| Copyright 2014, MetaQuotes Software Corp. |//| https://www.mql5.com |//+------------------------------------------------------------------+#property copyright"Copyright 2014, MetaQuotes Software Corp."#property link"https://www.mql5.com"#property version"1.00"#property strict#property indicator_chart_window//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+intOnInit()
{
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+//| Custom indicator iteration function |//+------------------------------------------------------------------+intOnCalculate(constint rates_total,
constint prev_calculated,
constdatetime &time[],
constdouble &open[],
constdouble &high[],
constdouble &low[],
constdouble &close[],
constlong &tick_volume[],
constlong &volume[],
constint &spread[])
{
int i, change, flhandle;
flhandle=FileOpen("test.bin", FILE_BIN|FILE_WRITE);
if (flhandle>0)
{
for(i=0; i<100; i++)
{
FileWriteDouble (flhandle, i, 4);
}
FileSeek(flhandle, 0, SEEK_SET); // goes to beginning of file
change=45;
FileWriteDouble(flhandle, change, 4); // writes 4 bytes to the beginning of fileFileClose(flhandle);
}
return(rates_total);
}
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
How can you FileSeek() without opening the file for reading ? try adding FILE_READ to your flags.
If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
angevoyageur:
FileSeek has nothing to do with read/write.It's a bug. Can you please report it to ServiceDesk of Metaquotes (you have to register at mql5.com) ?
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
As a reminder :
Build 613/614 are not official release but beta release only available through Metaquotes-Demo or Test servers.
It can happen that your terminal connected to other brokers are also updated if you have one terminal connected to one of the Metaquotes servers.
@ angevoyageur, where can i review the update history of the mt4?
I think I've found a bug in builds 613 and 614.
If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
I think I've found a bug in builds 613 and 614.
If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
This might help also: https://www.mql5.com/en/forum/108526
How can you FileSeek() without opening the file for reading ? try adding FILE_READ to your flags.
This might help also: https://www.mql5.com/en/forum/108526
I think I've found a bug in builds 613 and 614.
If you open a file for writing, fill it up with data, then go back to beginning of the file and change e.g. the first 4 bytes, all the other contents of the file will be deleted. In builds 610 (and older) only the 4 bytes were changed and the other parts of the file wouldn't be touched.
Here is an example code:
The code above gives a 400 byte file in build 610, however in build 613 and 614 test.bin will be only 4 bytes in size.
FileSeek has nothing to do with read/write.It's a bug. Can you please report it to ServiceDesk of Metaquotes (you have to register at mql5.com) ?
Ok, I submitted the bug to Service Desk.
Ok, I submitted the bug to Service Desk.
Where can I download the latest mt4 build?
Connect to demo.metaquotes.net:444 from your MT4 and it will update itself automatically.