Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is it possible to append to a file that is open and see the update?

Status
Not open for further replies.

ddelk

Programmer
May 28, 2003
47
0
0
US
I have a log file I am writing to that shows the status of my code at various stages. I would like to open this file once and watch the output as it is written. At the moment, I have to close the file and reopen it to see what has happened since I last opened it. Is this possible?
 
>I would like to open this file once and watch the output as it is written.
No...

Open and readall once and store all info in a variable. Display that variable. Then, whenever there is update, append the info to the variable the same way you append to the file (open, append, close). If the append is too frequent, then do it by batch and save (open, write, close) the info in the variable. Leaving a file open for appending long time in an uncertain environment (debugging...) may be undesirable.
 
Thanks tsuji. I came across a comment you made to someone regarding rtfbox control. I experimented with that and it seems to work fine. I still need to put the comments out to a text file for permanent record keeping but the rtfbox allows me to view the information as it happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top