Hi,
I had a file data.txt which the file size are 0 bytes. and i had python program which will access to write some data into the file occasionally
Anyone know how do mql5 to get the filesize without open and accessing into data.txt ?
For example :
if
data.txt file size =< 0 byte then print " No data "
else
print " got some data "
Thanks in Advance !
Not possible with MQL5, either use DLL calls or open the file with flag SHARED_READ, get the handle use FileSize() function and then close the file again.
Not possible with MQL5, either use DLL calls or open the file with flag SHARED_READ, get the handle use FileSize() function and then close the file again.
Thanks for reply.
currently my another python program not able to access the file data.txt because of mql5 are accessing the data.txt on "every tick". So that cause of Error 13 permission denied at python side. thats the reason of im thinking to add a filter to check file size at first before let mql5 occupy/access data.txt so python program able to access to write data into the file.
If anyone had ideas/methods of how to do it are highly appreciated
thanks in advance
Thanks for reply.
currently my another python program not able to access the file data.txt because of mql5 are accessing the data.txt on "every tick". So that cause of Error 13 permission denied at python side. thats the reason of im thinking to add a filter to check file size at first before let mql5 occupy/access data.txt so python program able to access to write data into the file.
If anyone had ideas/methods of how to do it are highly appreciated
thanks in advance
Use the appropriate share attributes. If the mql5 side is reading but the python is writing you need to use FILE_SHARE_WRITE in MQL5.
Use the appropriate share attributes. If the mql5 side is reading but the python is writing you need to use FILE_SHARE_WRITE in MQL5.
fileHandle = FileOpen("signal.txt", FILE_READ | FILE_WRITE | FILE_ANSI | FILE_SHARE_READ | FILE_SHARE_WRITE);
Do you mean if i just add this then python and mql5 can read and write the file at the same time ?
Thanks
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I had a file data.txt which the file size are 0 bytes. and i had python program which will access to write some data into the file occasionally
Anyone know how do mql5 to get the filesize without open and accessing into data.txt ?
For example :
if
data.txt file size =< 0 byte then print " No data "
else
print " got some data "
Thanks in Advance !