Click to See Complete Forum and Search --> : Can I see the file text content during the file's opened?


kshen
July 27th, 1999, 04:18 PM
I am writting a program to write a string to an exist file everyseveral seconds. I use CStdioFile to create and open a file, I can see the file text content only after the file's closed. My question is if I can see the content of the file during the file's opened. Must I close the file if I want to see the text content?

kshen

Paul Belikian
July 27th, 1999, 11:09 PM
Hi,

When you create the file with CFile, make sure you use the CFile::modeReadWrite in the nOpenFlags parameter. That should allow you to read and write to the file.



Regards,

Paul Belikian

esjayes
January 4th, 2001, 12:27 PM
Were you able to do this? I am having the same problem here.

Alex Fedotov
January 4th, 2001, 12:59 PM
Use CFile::shareDenyWrite mode flag then opening file for writing.
This will allow other programs such as Notepad to read file while
it is open.

Sam Hobbs
January 4th, 2001, 06:15 PM
You did not specify whether you want to read the text by the same program that is writing it or whether you want to read the text by another program. The answer varies depending upon which you need. I think you have answers for both possibilities, though.


****************************************************************************************************
Ratings are unimportant but feedback is. Let the helper and the worldwide community know what works, perhaps with ratings.