LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

help:when is the better time for flush to file.

I read a line every time from a text file and write to another file in a loop. When i put flush function into loop, the disk will

 

make a little noise and i don't feel better. I don't know which is better to flush to file: after every write or after exit from loop.

 

Or don't need it at all. Anyone can help me about this?

 

Thanks.

0 Kudos
Message 1 of 2
(2,256 Views)

You don't need to flush at all. The operating system will take care about this. When closing the file it will be flushed anyway.

 

You can use the flush function if you're continuously writing to a file from one application (keeping the file open) and reading from the file in another application (at the same time). 

 

Hope this helps,

Daniel

0 Kudos
Message 2 of 2
(2,249 Views)