If file copy for other folder, datas showed are different...

 

Hello.

I have a problem, very very crazy. I create the fallow code:

int start()
{
//----
int handle = FileOpen("file.csv", FILE_WRITE, ";");
int bar_teste= 10;
if(handle>0)
{
// table column headers recording
FileWrite(handle, "Time;Open;High;Low;Close;Volume");
// data recording
for(int i=0; i<bar_teste; i++)
FileWrite(handle, TimeToStr(Time[i]), Open[i], High[i], Low[i], Close[i], Volume[i]);
FileFlush(handle);
//FileSeek(handle,0,SEEK_SET);
FileClose(handle);
}
//----
return(0);

}


Very simple this code. My file is in experts/file...

But all datas, all the candle are saved in the file. But my code should save only the first 10 candle.

But when I copy my file file.csv for the folder Desktop, for exemple, only the first 10 candle are showed. and now, what happens?

REally, in folder experts/file my csv show 4360 lines... But if I simple copy the file and paste in desktop and open it, only 10 lines are showed...


EDIT:

If I copy from desktop and paste in experts/file again, the datas in csv file back to 4360 lines...

 

It sounds to me like you are running this as an expert instead of a script...? It should be a script.


p.s.

 
 
WHRoeder:
Duplicate post, see https://www.mql5.com/en/forum/127281
Yes. bisewski, there is no reason to open a new thread for the same problem... Just continue the old thread.
 
gordon:
Yes. bisewski, there is no reason to open a new thread for the same problem... Just continue the old thread.

I really thanks for you help.

First, not duplicate post, it is an other code. This code, save all datas, close, open,higth and low in an csv file and not have the loop.

And other post I quastion how I can creat an loop for save only close information in txt file.

 
bisewski:

I really thanks for you help.

First, not duplicate post, it is an other code. This code, save all datas, close, open,higth and low in an csv file and not have the loop.

And other post I quastion how I can creat an loop for save only close information in txt file.

EDIT:


The problem isn't the code, my code is correctely. I think that my problem is my Vista 64, cinfigurations in my administrator user...I use the folder experts/files for to put my files.

If I create an new scrypt and run, for first time, my datas are saved well. BUt if I run my scrypt again, my datas is same, not update...If I delete the file and run scrypt, so the file is created in folder experts/files with the same datas, not updated datas...If I change my code, for exemplo, FILEWRITE(handle, "test001") to FILEWRITE(handle, "teste005"), the data saved in file is test001...


EDIT: If I delete the old scrypt and creat a new script but I use the same code, the same problem...But, if I delete the script and change only the name file, for exemplo, from test.csv to test01.csv in the first time my scrypt read new datas...But if I run again, the same problem...

 
bisewski:

EDIT:


The problem isn't the code, my code is correctely. I think that my problem is my Vista 64, cinfigurations in my administrator user...I use the folder experts/files for to put my files.

If I create an new scrypt and run, for first time, my datas are saved well. BUt if I run my scrypt again, my datas is same, not update...If I delete the file and run scrypt, so the file is created in folder experts/files with the same datas, not updated datas...If I change my code, for exemplo, FILEWRITE(handle, "test001") to FILEWRITE(handle, "teste005"), the data saved in file is test001...


EDIT: If I delete the old scrypt and creat a new script but I use the same code, the same problem...But, if I delete the script and change only the name file, for exemplo, from test.csv to test01.csv in the first time my scrypt read new datas...But if I run again, the same problem...


If anybody have the same problem, you need to disable the system Vista UAC.
Reason: