Download MetaTrader 5

Help:file operation

To add comments, please log in or register
jianhua296
198
jianhua296  
i want to add one file's data to another file's end position,how to realize it ?

FileCopy("src_filename",0,"dst_filename",FILE_REWRITE);

this function can only rewrite the second file,but not remain its original data.
if i open the two files and write data step by step ,it's ok .But the source file may has diffent format,so it's very trouble!
using dll? Maybe this is another way,but i donot like it.
how can i do?Does i make some mistakes when using above function?or MQL5 has other standard function to solve this problem?
Documentation on MQL5: Standard Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags
  • www.mql5.com
Standard Constants, Enumerations and Structures / Input/Output Constants / File Opening Flags - Documentation on MQL5
jianhua296
198
jianhua296  
nobody know?
Nazariy Stapyak
1751
Nazariy Stapyak  
Use
int file_handle = FileOpen(filename,FILE_READ|FILE_WRITE|FILE_CSV);
then
FileSeek(file_handle,0,SEEK_END);
and then write to the end of this file any data that you want...
jianhua296
198
jianhua296  
WWer:
Usethenand then write to the end of this file any data that you want...
you donot understand my question,i know the way
To add comments, please log in or register